Thread: System Info
View Single Post
Old Feb 14th, 2005, 10:04 PM   #2
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
You're going to need to declare main like this:

 int main(int argc, char *argv[])

where argc is the number of arguments that are passed from the command line, and argv is a string representation of an argument. So for instance, in your -d example, argc would be 2 (I believe), since their are two arguments (the name of your program and "-d"), and argv[1] would be "-d".
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote