阅读下列程序,则在执行后,程序的运行结果为( D)为什么呢?
19.阅读下列程序,则在执行后,程序的运行结果为( )。答案:D #include"stdio.h"&...
19.阅读下列程序,则在执行后,程序的运行结果为( )。答案:D
#include "stdio. h"
#include "string. h"
main( )
{ char a[30] ="nice to meet you!" ;
strcpy(a+strlen(a)/2," you");
printf(" % sn" ,a);}
A)nice to meet you you
B)nice to
C)meet you you
D)nice to you
答案是D,为什么不是nice to you you!呢,不是meet被you覆盖掉了变成nice to you you!嘛 展开
#include "stdio. h"
#include "string. h"
main( )
{ char a[30] ="nice to meet you!" ;
strcpy(a+strlen(a)/2," you");
printf(" % sn" ,a);}
A)nice to meet you you
B)nice to
C)meet you you
D)nice to you
答案是D,为什么不是nice to you you!呢,不是meet被you覆盖掉了变成nice to you you!嘛 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询