首页 > 试题广场 >

写出下列程序的输出结果

[问答题]

写出下列程序的输出结果

#include <string.h>

#include <stdio.h>

int main (void)

{

char a[] = "Who am I ?";

char b[20] , *p1, *p2;

p1 = a; p2 = b;

for(; *p1 != '\0'; p1++, p2++)

*p2 = *p1;

*p2 = '\0';

printf("string a is: %s\n", a);

printf("string b is: ");

p2 = b;

puts(p2);

return 0;

}

string a is Who am I

string b is Who am I

发表于 2017-05-17 00:14:56 回复(0)