C Programming - Command Line Arguments - Discussion

Discussion Forum : Command Line Arguments - Find Output of Program (Q.No. 8)
8.
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample friday tuesday sunday
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%c", **++argv);
    return 0;
}
s
f
sample
friday
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
17 comments Page 2 of 2.

J.sangeetha said:   9 years ago
I want a clear explanation for this question. Please provide me.

Manish said:   1 decade ago
I still could not get understood yet. Please further explain.

Abp said:   10 years ago
Yes if there was %s in out then output would be friday.

Alli said:   1 decade ago
Give complete meaning for **argv[]

Sugimalathi said:   1 decade ago
Explain this answer please.

Deepika said:   1 decade ago
Why **argv[] is used?

Lakshmi said:   1 decade ago
Its not clear.


Post your comments here:

Your comments will be displayed after verification.