单选题 C++
题号 #2607236

下列程序的运行结果为(    )。
#include<iostream.h>
void print(double A.
{
cout<<++a:
}
void print(int atint B.
{
cout<<b<<a:
}
void main()
{
print(1.2);
eout<<””:
print(3,4);
}

进入在线模考

参考答案

D

答案解析

本题考查的是对重载函数的掌握,因为
++a是右结合的,所以a先自加1再输出,即为2.2,之后调用函数print(int a,int b)输出h和a,即43。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考