What is argc and argv 1 in C? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

What is argc and argv 1 in C?

C

23rd Apr 2019, 8:49 AM
B.L Sibanyoni
B.L Sibanyoni - avatar
3 Answers
+ 10
It has to do with CMD args, if i recall correctly "argc" tells you the number of args and "argv" tells you the actual arg values. BTW: https://www.sololearn.com/discuss/162270/?ref=app
23rd Apr 2019, 8:58 AM
Maz
Maz - avatar
+ 8
The name of the variable argc stands for "argument count"; argc contains the number of arguments passed to the program. The name of the variableargv stands for "argument vector". A vector is a one-dimensional array, andargv is a one-dimensional array of strings.
26th Apr 2019, 7:42 AM
B.L Sibanyoni
B.L Sibanyoni - avatar