Command Line Arguments

Q1: What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include<stdio.h>
#include<stdlib.h>

int main(int argc, char **argv)
{
    int i;
    for(i=1; i<=3; i++)
        printf('%u\n', &argv[i]);
    return 0;
}
If the first value printed by the above program is 65517, what will be the rest of output?

A 65525 65531

B 65519 65521

C 65517 65517

D 65521 65525

ANS:A - 65525 65531

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.