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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.