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 |
What is hungarian notation? Is it worthwhile?
what is the difference between c and c++?
write a program without using main function?
Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.
How do you print only part of a string?
Explain how do you override a defined macro?
What are the preprocessors?
What is the difference between fread buffer() and fwrite buffer()?
True or false: If you continuously increment a variable, it will become negative? 1) True 2) False 3) It depends on the variable type
define function
What is the general form of a C program?
How to write a code for random pick from 1-1000 numbers? The output should contain the 10 numbers from the range 1-1000 which should pick randomly, ie ,for each time we run the code we should get different outputs.