How do I access command-line arguments?

Answers were Sorted based on User's Feedback



How do I access command-line arguments?..

Answer / 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

How do I access command-line arguments?..

Answer / 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

More C Interview Questions

formula to convert 2500mmh2o into m3/hr

1 Answers  


Is r written in c?

1 Answers  


What are the disadvantages of c language?

1 Answers  


Write a program in c to input a 5 digit number and print it in words.

11 Answers  


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

1 Answers  


What is the use of bitwise operator?

1 Answers  


What is a symbolic constant?

1 Answers  


What is the difference between array and structure in c?

1 Answers  


what is difference b/w extern & volatile variable??

6 Answers   Teleca,


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

1 Answers  


What's the total generic pointer type?

1 Answers  


Write a program to find factorial of a number using recursive function.

1 Answers   Global Logic, TCS,


Categories