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 pragma c?
Write a program to print the prime numbers from 1 to 100?
develop algorithms to add polynomials (i) in one variable
where do we use structure pointer?
Find the O/p of the following struct node { char *name; int num; }; int main() { struct node s1={"Harry",1331}; struct node s2=s1; if(s1==s2) printf("Same"); else printf("Diff"); }
What are the types of arrays in c?
What is 2c dna?
How. To pass the entrance test
Why is event driven programming or procedural programming, better within specific scenario?
Why c is faster than c++?
What are the __date__ and __time__ preprocessor commands?
What is structure packing ?