下列程序的输出结果为( )。 #include (iostream) using namespace std; void main( ) char,a[ ] = { "hello" ," the" ," world" }; char * * pa = a: pa + +; cout << * pa << ENDL; }A.helloB.theC.worldD.hellotheworld

题目

下列程序的输出结果为( )。 #include (iostream) using namespace std; void main( ) char,a[ ] = { "hello" ," the" ," world" }; char * * pa = a: pa + +; cout << * pa << ENDL; }

A.hello

B.the

C.world

D.hellotheworld


相似考题
参考答案和解析
正确答案:B
解析:指针与数组对应关系,*p++访问数组第二个元素。
更多“下列程序的输出结果为( )。#include (iostream)using namespace std; void main( )char,a[ ] = { ”相关问题
  • 第1题:

    下列程序的输出结果为 include void main( ) { char * a[ ] ={"hello},"the"," wo

    下列程序的输出结果为

    #include<iostream.h>

    void main( )

    {

    char * a[ ] ={"hello},"the"," world"};

    char * * pa=a;

    pa++;

    cout < < * pa < < endl;

    }

    A.hello

    B.the

    C.world

    D.hellotheworld


    正确答案:B
    解析:本题主要考查的是指针数组和指向指针的指针之间的关系,其中a是指针数组,pa是指向指针数组行的指针,所以pa自加1相当于指向下一行。

  • 第2题:

    下列程序的输出结果为includevoid main( ){char * a[ ]={"hello","the","world"};c

    下列程序的输出结果为 #include<iostream.h> void main( ) { char * a[ ]={"hello","the","world"}; char * * pa=a; pa++; cout <<*pa<<end1; }

    A.hello

    B.the

    C.world

    D.hellotheworld


    正确答案:B
    解析:本题主要考查的是指针数组和指向指针的指针之间的关系,其中a是指针数组,pa是指向指针数组行的指针,所以pa自加1相当于指向下一行。

  • 第3题:

    下列程序的输出结果是()。includevoid main(){char*Str;str="testI";cout<

    下列程序的输出结果是( )。 #include<iostream.h> void main() { char*Str; str="testI"; cout<<str[5]; }

    A.test!

    B.test

    C.空字符

    D.异常


    正确答案:C
    解析: 字符指针str值为“test!”,它们的下标由0开始,并且具有一个尾符,输出str[5]的位置为尾符标识,指针字符指向的尾符为空。所以答案为空字符,即选项C)正确。

  • 第4题:

    以下程序的输出结果是()。includeincludeusing namespace std;void func(cha

    以下程序的输出结果是( )。 #include<iostream> #include<stdlib> using namespace std; void func(char **m) { ++m; cout<<*m<<endl; } main() { static char *a[]={"MORNING","AFTERNOON","EVENING"); char **n; n=a; func(n); system("PAUSE"); return 0; }

    A.为空

    B.MORNING

    C.AFTERNOON

    D.EVENING


    正确答案:C

  • 第5题:

    下列程序的输出结果为includevoid main(){char*a[]={"hello","the","world"};char*

    下列程序的输出结果为 #include<iostream.h> void main() { char*a[]={"hello","the","world"}; char**pa=a; pa++; cout<<*pa<<end1; }

    A.hello

    B.the

    C.world

    D.hello the world


    正确答案:A
    解析:本题考查的是字符数组的初始化,选项B)中用3个元素初始化大小为2的数组,越界了;选项C)中应该是2行3列的数组,题中使用3行2列初始化;选项D)中数组合后应用方括号。