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

What is the scope of static variable in c?

537


What does c in a circle mean?

585


I need a sort of an approximate strcmp routine?

663


In C language what is a 'dangling pointer'?

643


What is the heap in c?

647






Distinguish between actual and formal arguments.

593


how can use subset in c program and give more example

1505


Which is better malloc or calloc?

656


Write a code to generate divisors of an integer?

645


What is the size of structure in c?

705


How can I get back to the interactive keyboard if stdin is redirected?

673


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1909


Explain how do you list a file’s date and time?

621


Why c is called free form language?

575


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

658