void main ( int argc, char** argv )
{
glutInit ( &argc, argv );
-
}
Then the address of argc is past on to the glutinit function with the "argv" pointer. Why do we have to do that?
Thanks for any help.
Simple Question.
hi
What does the "int argc, char** argv" mean when they are uesd in the main function?
For example:
Those are related to the command line arguments. Eg, "program.exe /d". It''s been awhile, but I believe argc is the number of parameters passed, and argv is a character array of the parameters. Check some C++ tuts for info on that.

Yes that is correct. "argc" is the number of tokens specified on the command line. And "argv" is an array of char * to the tokens.
Using the example given by Nemesis2k2:
argc = 2
argv = {"program.exe", "/d"}
Since glut is C driven (I believe), you need to pass in pointers to objects instead of passing by reference (as you would in C++)
Using the example given by Nemesis2k2:
argc = 2
argv = {"program.exe", "/d"}
Since glut is C driven (I believe), you need to pass in pointers to objects instead of passing by reference (as you would in C++)
---K-1 Productions: Come visit us here.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement