In your C programs, you might have the need to accept parameters from the command line when the command launches.

For simple needs, all you need to do to do so is change the main() function signature from

int main(void)

to

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

argc is an integer number that contains the number of parameters that were provided in the command line.

argv is an array of strings.

#c #c# #c++ #programming-c

Learn how to access the command line parameters in C
1.25 GEEK