Welcome Guest.

1Answers

What is the running result of this program segment?

Asked by: Lisa 61 views IT May 21, 2022

char a [7] = "abcdef";

Char b [4] = "abc";

strcpy (a, b);

Printf ("%c \ n", a [5]);

1 Answers

  1. +7Votes  

    The complete result of the program is

    F

    The following is testing:

    Analysis:

    Strcpy (a, b); After that, the actual value of A in the memory is

    ABC \ 0EF

    , which is a [0] ~ a [5], respectively ‘a’, ‘B’, ‘c’, 0, ‘e’, ‘f’

    So, a [5] results are ‘f’

    Campbell- May 21, 2022 |