|
-
Oct 14th, 2001, 10:37 AM
#1
Thread Starter
Member
Another completely ignorant question (about arguments)
How can I read what arguments what passed to my proggie? In Java, it's public static void main(String[] args), so is it int main(char *args) in C++?
-
Oct 14th, 2001, 11:03 AM
#2
Frenzied Member
Code:
int main(int argc, char* argv[])
{
program-statements
}
argc
An integer specifying how many arguments are passed to the program from the command line. Because the program name is considered an argument, argc is at least 1.
argv[x] contains argument.
-
Oct 14th, 2001, 11:05 AM
#3
Thread Starter
Member
Cool, thanks.
-
Oct 14th, 2001, 11:16 AM
#4
Monday Morning Lunatic
In the standard, argv[argc] is defined to be NULL
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|