this is just something i dont get...
Code:int main ( int argc, char *argv[] )
this is just something i dont get...
Code:int main ( int argc, char *argv[] )
What exactly dont you get?
Go to the FAQ and read about command line arguments then come back if you still havent grasped it.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Its used when you want to run your program with command line arguments
Like if youve ever seen some programs run like so:
./steam -update -username -password
just an example, not exactly what youd use but just to show, that the hyphenated words like -update are arguments to steam application, the application uses them to run a different way.
i just dont know what it is or what its used for... the tutoral didnt help
Its used for exactly what JoshR said.
If you ever played some older games that didnt have screen resolution/etc option windows, they would use command-line arguments to allow the user to change settings that way. Also used a lot in command prompt programs (-s -b -start -e -i -u -make -exit -shutdown, etc).
Basicly like if you had a shortcut to "C:\game.exe" -res800x600 -256colors -fullscreen, that would give those commands. Then in int main you would use to check if int argv[1] (resolution option) is == res800x600 (or other ones you might want). Then for the next command, you can check if argv[2] is == to 256colors then in that if statement you do the code to set it to 256colors, you might have an else if == 32colors, etc. Of course that wouldnt be flexible since the commands could be mixed up, so you might need a few || operators in it. Not that I know why you'd use command-line arguments for this example (I'd rather have an options screen).
Command-line arguments are like the ability to set values to strings that are inside the program, from outside of the program (command-lines).
Warning: Have doubt in anything I post.
GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101
k +thanx that helped