In linux, argv[0] by command-line argument can be occupied by _________
Answer: D
No answer description available for this question.
Enter details here
Comment on the following.
const int *ptr;
Answer: A
No answer description available for this question.
Enter details here
Which of the following is correct to interpret Hello World as a single argument?
1. $ ./output 'Hello World'
2. $ ./output Hello World
Answer: C
To interpret space separated words as single argument one can use single or double quotes.
Enter details here
What is the output of this C code?
#include
void main()
{
int x = 0;
int *ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
int main()
{
int i = 10;
int *p = &i;
foo(&p);
printf("%d ", *p);
printf("%d ", *p);
}
void foo(int **const p)
{
int j = 11;
*p = &j;
printf("%d ", **p);
}
Answer: B
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
int main()
{
int i = 10;
void *p = &i;
printf("%d\n", (int)*p);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Which is the correct way of handling arguments with spaces?
Answer: B
One can use either single or double quotes to handle command line argument with spaces in-between. For example, ./output “Hello World” has 2 command line argument “./output” and “Hello World”.
Enter details here
What type of array is generally generated in Command-line argument?
Answer: C
No answer description available for this question.
Enter details here
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog friday tuesday sunday
/* myprog.c */
#include
int main(int argc, char *argv[])
{
printf("%c", *++argv[1]);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
The first argument to be supplied at command-line must always be count of total arguments.
Answer: B
No answer description available for this question.
Enter details here