How do I access command-line arguments?
Answers were Sorted based on User's Feedback
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 |
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 |
Toggle nth bit in a given integer - num
Write code for atoi(x) where x is hexadecimal string.
Can we declare variable anywhere in c?
Why isn't any of this standardized in c? Any real program has to do some of these things.
wt is diference between int and int pointer as same as float and float pointer and char and char pointer
Explain what is the difference between a string and an array?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
"I LOVE MY COUNTRY" write a c program to get "COUNTRY MY LOVE I" as the output. Use any other programming language. It is not mandatory to use C.
11 Answers ABC Infotech, ADP, College School Exams Tests, Kovair,
What is union and structure?
What does 3 periods mean in texting?
find the size of structure without using the size of function
What is header file definition?