Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming: My Question: How to use C language to ask filename from user and put file contents in a buffer and update the count

C Programming:

image text in transcribed

My Question: How to use C language to ask filename from user and put file contents in a buffer and update the count of bytes/words? (how to write getFname(..) method in C?)

typedef unsigned short u short; typedef unsigned int u int32; typedef unsigmed long u int64 uint64 getCode ( *buffer, int count) /* count = byte/word count */ egister u int64 total-0: ile (count- return XXXx; int main(...) I - ask filename from user and put file contents in a buffer and update the count of bytes/words. call getCodeOfunction to calculate code using one's complement. getFname (...) code -getcode (buffer,count) use code to validate any user-specified file'/ getFname (...) testvalidity (code, Fname)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started