Computer Science, asked by anusubathra, 11 months ago

What will be the output of the following statement?
(assuming the input is "Smarter way to learn")
printf ("%s\n",
argv[argc]);​

Answers

Answered by codiepienagoya
14

The output of the given code can be define as follows:

Output:

The code will give "Segmentation Fault" error

Explanation:

  • The argc includes the number of total variable inputs in main(int argc, char * * argv).
  • It also contains the file. Therefore, Argv includes a range of all terminal values, that contains the file.
  • The argc = the argv collection number, and also the last argv index, must be argc-1 as C and C++ are).
  • This makes argv[argc] an optimization error as they address is not yet assigned.

Learn more:

  • Finding the output: https://brainly.in/question/15321336
Answered by oviwani172
1

Answer:

Explanation: way to learn

Similar questions