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 sizeof return in c?
we have to use realloc only after malloc or calloc ? or we can use initially with out depending on whether we are using malloc or calloc in our program ?
Explain the difference between the local variable and global variable in c?
while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
main() { int i=400,j=300; printf("%d..%d"); }
#include<stdio.h> #include<conio.h> int main() { int a[4][4]={{5,7,5,9}, {4,6,3,1}, {2,9,0,6}}; int *p; int (*q)[4]; p=(int*)a; q=a; printf("\n%u%u",p,q); p++; q++; printf("\n%u%u",p,q); getch(); return 0; } what is the meaning of this program?
What is the purpose of main() function?
Is c easier than java?
Compare interpreters and compilers.
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
explain what is fifo?