Ask your own question, for FREE!
Computer Science 6 Online
OpenStudy (anonymous):

guys can anyone help with learning files and file operations in c.......and command line arguments in c

OpenStudy (anonymous):

you can learn it with thenweboston

OpenStudy (anonymous):

Give me a medal

OpenStudy (anonymous):

yes,but be specific what do you want?

OpenStudy (anonymous):

hey if u find it a good ans then give me a medal

OpenStudy (anonymous):

In C, command line arguments are passed into your program via your main functions parameters. int main(int argc, const char **argv) Means that the number of arguments your program received is in argc and argv holds the address of an array of strings which are the arguments themselves. If you would like to print them out you could simply have your function written thusly: #include <stdio.h> int main(int argc, const char **argv) { int i =0; for(; i < argc; i++) printf("%s\n", argv[i]) return 0; } File and file operations are not really well defined by C and fall more under the domain of your operating system, though most are at least a little POSIX compliant.

OpenStudy (anonymous):

Forgot a semi-colon on the printf statement. Sorry bout that.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!