0

Hey,
How do you read from the command line in C? I need to read 10 arguments from the command line. Can I use char* argv[] as a parameter in the main function to do so?

Thanks.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by thines01
0

Hey,
How do you read from the command line in C? I need to read 10 arguments from the command line. Can I use char* argv[] as a parameter in the main function to do so?

Thanks.

You can use that or
int main(int argc, char** argv)

where argc is the number of command-line parameters and argv is an array containing pointers to the parameters.

argv[0] is the program name itself.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.