网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下列说明const chr* ptr;中,ptr应该是【 】。
参考答案
更多 “ 下列说明const chr* ptr;中,ptr应该是【 】。 ” 相关考题
考题
main函数中发生编译错误的语句是______。 include class A { public: int a; const i
main函数中发生编译错误的语句是______。include<iostream.h>class A{public:int a;const int b;A( ):a(10),b(20){}void fun( )const{cout<<"a="<<a<<"\tb="<<b<<endl;}};void main( ){A obj1;const A*ptr=new A;ptr=obj1;ptr->a=100;ptr->fun( );}
考题
下列程序的输出结果是______。includeusing namespace std;int main() {char a []="He
下列程序的输出结果是______。 #include<iostream> using namespace std; int main() { char a []="Hello, World"; char *ptr=a; while (* ptr) { if(*ptr)= 'a' *ptr' <= 'z') cout << char(*ptr+'A'-'a'); else cout << *ptr; ptr++; } return 0; }A.HELLO,WORLDB.Hello,WorldC.hELLO, wORLDD.hello,world
考题
下列有关指针的用法中错误的是( )。A.int i;int *ptr=i;B.inti;int *ptr;i=*ptr;C.int *ptr;ptr=0;D.int i=5;int *ptr;*ptri;
考题
在整型指针变量ptr1、ptr12的定义中,错误的是 ______。A.int x, *ptr1, ptr2;B.int*ptrl, x, *ptr2;C.int x,*ptrl=x,*ptr2;D.int*ptr1, x,*ptr2=x;
考题
下列有关指针的用法中错误的是( )。A.int i;int*ptr=i;B.int i;int*ptr;i=*ptr;C.int*ptr;ptr=0;D.int i=5;int*ptr;*ptri;
考题
下列程序的输出结果是()。includeusing namespace std;int main(){char a[]=""Hello,W
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]=""Hello,World"; char*ptr = a; while(*ptr) { if(*ptr>= 'a' *ptr<='z') cout<<char(*ptr+'A'-'a'); else cout<<*ptr; ptr++; } retur 0; }A.HELLO, WORLDB.Hello, WorldC.HELLO, worldD.hello, world
考题
下列程序的输出结果是 include usingnamespacestd; int main () {chara []="Hello,W
下列程序的输出结果是 #include <iostream> using namespace std; int main () { char a [] = "Hello,World": char*ptr = a; while (*ptr) { if(*ptr>= 'a' *ptr <='z' cout<<char{*ptr+'A'-'a'); else cout<<*ptr; ptr++; } return 0; }A. HELLO. WORLDB. Hello, WorldC. hELLO, wORLDD. hello, world
考题
【单选题】设有以下说明语句: char sl[20]="hello",s2[20]="china";const char *ptr=s1; 以下语句中不符合C++语法规则的语句是 。A.strcpy(s2,ptr);B.ptr=s2;C.ptr=ptr+4;D.*ptr=*s2;
热门标签
最新试卷