How do I access command-line arguments?

Answer Posted / srujana

we can access the command-line arguments by passing the
arguments argv and argc on to the main() function where
argv represents an array of pointers to strings and argc
holds the int value which is equal to the number of strings
that are in argv

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is variable and explain rules to declare variable in c?

658


What does & mean in scanf?

706


What is f'n in math?

712


What's the best way of making my program efficient?

729


What is the use of gets and puts?

694






Is python a c language?

650


In a byte, what is the maximum decimal number that you can accommodate?

728


What is maximum size of array in c?

676


I heard that you have to include stdio.h before calling printf. Why?

690


What tq means in chat?

702


Is c is a procedural language?

711


#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1358


What extern c means?

643


How many identifiers are there in c?

676


What is difference between array and pointer in c?

629