Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: c++
|
Posted: Dec 11, 2002 6:07 PM
|
|
This forum is about C#, not C or C++, but: - argc is an integer parameter to main() in a C or C++ program that indicates the length of argv, which is an array of pointers to strings representing the parsed command line. So, if you run the program "mytest one two", argc is 3, argv[0] is "mytest", argv[1] is "one" and argv[2] is "two". Try compiling and running this little C++ program with command lines of your choice:
#include <iostream.h>
void main( int argc, char * argv[] )
{
cout << "argc: " << argc << endl;
for( int i = 0; i < argc; i++ )
cout << "argv[" << i << "]: " << argv[i] << endl;
}
- There is a standard C library routine called unlink() for deleting files.
|
|