How do I access command-line arguments?

Answer Posted / reejusri

In order to access the command arguments, the main()
function must have a prototype similar to the following.
int main(int argc, char * argv[])

The names argc and argv are usually used for the
parameters, but a programmer could use different names.

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can a number be converted to a string?

733


What is use of pointer?

688


What is a char in c?

644


Why is #define used?

885


What is the difference between fread and fwrite function?

718






Is c is a middle level language?

696


Can i use “int” data type to store the value 32768? Why?

866


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

728


What is #include stdio h and #include conio h?

681


What is getch c?

951


How to compare array with pointer in c?

709


Explain how can a program be made to print the name of a source file where an error occurs?

807


Can you write the function prototype, definition and mention the other requirements.

776


What does 2n 4c mean?

859


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

698