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 |
consagous technology placement paper
what is the difference between declaration and definition of a variable or function ?
Differentiate between the = symbol and == symbol?
What is a null string in c?
for questions 14,15,16,17 use the following alternatives:a.int b.char.c.string.d.float
write a programme that inputs a number by user and gives its multiplication table.
How to print %d in output
difference between c and c++
main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); }
2 Answers Vector, Vector India,
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
cavium networks written test pattern ..
when to use : in c program?