guys can anyone help with learning files and file operations in c.......and command line arguments in c
you can learn it with thenweboston
Give me a medal
yes,but be specific what do you want?
hey if u find it a good ans then give me a medal
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.
Forgot a semi-colon on the printf statement. Sorry bout that.
Join our real-time social learning platform and learn together with your friends!