Why use argc and argv ?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why use argc and argv ??

14th Sep 2017, 4:31 PM
PradheepvikišŸ˜ŽšŸ˜€
PradheepvikišŸ˜ŽšŸ˜€ - avatar
2 Respostas
0
tq
14th Sep 2017, 6:08 PM
PradheepvikišŸ˜ŽšŸ˜€
PradheepvikišŸ˜ŽšŸ˜€ - avatar
0
argc4Ā  argv[0]gccĀ  argv[1]-oĀ  argv[2]myprogĀ  argv[3]myprog.c As you can see, the first argument (argv[0]) is the name by which the program was called, in this caseĀ gcc. Thus, there will always be at least one argument to a program, andĀ argcĀ will always be at least 1.
14th Sep 2017, 7:12 PM
Rachit
Rachit - avatar