单项选择题

有如下程序:
#include <iostream>
using namespace std;
int main( )
char str[100],*P;
cout<<"please input a string:";
cin>>str;
P=str;
for(inti=0;*P!=’\0’;p++,i++);
cout<<i<<endl;
return 0;
运行这个程序时,若输入字符串为
Abcdefg abcd
则输出结果是

A.7
B.12
C.13
D.100
<上一题 目录 下一题>
热门 试题

单项选择题
如果不使用多态机制,那么通过基类的指针虽然可以指向派生类对象,但是只能访问从基类继承的成员。有如下程序,没有使用多态机制: #include <iostream> using namespace std; class Base int a,b; public: Base(int x,inty)a=x;b=y; void show( )cout<<a<<’,’<<b<<endl; ; class Derived:public Base int C,d; public: Derived(int x,int y,int z,intm):Base(x,y)c=z;d=m; void show( )cout<<c<<’,’<<d<<endl; . int main( ) Base BI(50,50),*pb; Derived D1(10,20,30,40); pb=&D1; pb->show( ); return 0; 程序的输出结果是
A.10,20
B.30,40
C.20,30
D.50,50
填空题
在关系数据库中,把数据表示成二维表,每一个二维表称为______。
相关试题
  • 空格
  • 下列程序的输出结果为: Ohject id=0 ...
  • public A
  • 补充完整下面的类定义: const double P...
  • 如下程序声明了一个使用两个通用数据类型的...