Skip to main content
GameDev.net gamedev.net
🔒 Locked

Parsing Cmdline

Started by SKSlayer Oct 19, 2000 at 1:41 PM 8 replies 450+ views
Original Post
SKSlayer
SKSlayer
An other question How do I parse the command line of my prog (Windows and DOS) ?? Little sample ?
(you can find me on IRC : #opengl on undernet)
Nate
Nate
It's pretty simple.

int main(int argc, char **argv)
{
for (int j = 0; j < argc; j++)
printf("%s\n", argv[j]);
}

argv[0] is the path and program name and everything after it is what was on the command line.

Nate Miller
http://nate.scuzzy.net

Edited by - Nate on October 19, 2000 6:14:57 PM
SKSlayer
SKSlayer
And how about the winmain ?
(you can find me on IRC : #opengl on undernet)
Nate
Nate
It works the same way. Look in MSDN.

Nate Miller
http://nate.scuzzy.net
SKSlayer
SKSlayer
Sorry, my cdrom drive is broken
I already said it in an other thread so, that''s why I am asking here
(you can find me on IRC : #opengl on undernet)
SKSlayer
SKSlayer
I just can''t find it
(you can find me on IRC : #opengl on undernet)
derwiath
derwiath

Helloy!

The url to WinMain reference is:
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/winui/windows_64ku.htm

I really recomend that you take some time to
get familiar with MSDN. It''s a unvaluable resourse
once you know how to use it.
Personally, I don''t think I could manage without it at all.

Good Luck!!
/Derwiath

------------------------------- Derwiath -
oglman
oglman
quote:
Personally, I don''t think I could manage without it at all.


Ha! I haven''t even bothered to install MSDN and I have been programming DOS, win32, and openGL for at least a year on it without any use of MSDN whatsoever!
Mezz
Mezz
Thanks for sharing your ego trip oglman.

Either that or you have been "programming DOS, win32, and openGL for at least a year on it without any use of MSDN whatsoever!"
But have been doing it very badly.

-Mezz

Edited by - Mezz on October 21, 2000 1:46:13 PM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.