could anyone post some examples of argc and argv for me. I am unsure about it. I have to create a program reading a text file using argv and argc. And then writing it to a binary. That part I understand.
could anyone post some examples of argc and argv for me. I am unsure about it. I have to create a program reading a text file using argv and argc. And then writing it to a binary. That part I understand.
This will print the entire command line set you use to invoke said program.Code:#include <stdio.h> int main ( int argc, char * argv[] ) { int x; for( x = 0; x < argc; x++ ) printf("argv[%d] is: %s\n", x, argv[x] ); return 0; }
Quzah.
Hope is the first step on the road to disappointment.
Ah, the two most important parameters in a C program. You will find them to be extremely useful in your production, especially with file specification. Enjoy!
--Garfield