下面程序的输出结果是( )。 #include #include"string.h" void main() {char a[]="Hello Test",b[]="Test"; strcpy(a,b);

admin2021-06-10  13

问题 下面程序的输出结果是(    )。
    #include
    #include"string.h"
    void main()
    {char a[]="Hello Test",b[]="Test";
    strcpy(a,b);
    cout<    }

选项 A、Hello   
B、Test
C、Hello Test
D、Hello Test HelloTest

答案B

解析 程序中首先定义字符数组a和b,其值分别为“Hello Test”和“Test”。然后利用strcpy复制函数,将b的值复制给a,所以输出a的结果为Test。
转载请注明原文地址:https://kaotiyun.com/show/kufp777K
0

最新回复(0)