g++ compiler
hossein shoghian
hossein.shoghian@gmail.com
Fri Jan 29 09:23:00 GMT 2010
hi
please help me
how to compiling this main with GCC, the GNU Compiler
i use g++ -pthread -Wall main.cpp
but don't pass argument
main.cpp
int main(int argc, char *argv[]) {
/* Verify the correct number of arguments were passed in */
if(argc != 4) {
fprintf(stderr, "USAGE:./main.out <INT> <INT> <INT>\n");
}
int mainSleepTime = atoi(argv[1]);
int numProd = atoi(argv[2]);
int numCons = atoi(argv[3]);
exit(0);
}
More information about the Gcc-help
mailing list