单项选择题
一个函数带有参数说明时,则参数的默认值应该在()中给出。
A.函数定义
B.函数声明
C.函数定义或声明
D.函数调用
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
有以下程序: #include <iostream> #include <math> using namespace std; class point private: double x; double y; public: point(double a,double b) x=a; y=b; friend double distance(point a,point b) ; ; double distance(point a,point b) return sqrt ((a.x-b.x)* (a.x-b.x)+(a.y-b.y)*(a.y-b.y)); int main ( ) point pl(1,2); point p2 (5, 2); cout<<distance (pl,p2) <<end1; return 0; 程序运行后的输出结果是()
A.1
B.5
C. 4
D. 6
点击查看答案&解析
单项选择题
有如下函数模板定义: template<typename T1,typename T2,typename T3> T2 plus T1 t1,T3 t3)return t1+t3; 则以下调用中正确是
A) plus(3,5L);
B) plus<>(3,5L);
C) plus<int>(3,5L);
D) plus<int,double>(3,5L);
点击查看答案&解析
相关试题
软件是程序、数据和______的集合。
一棵二叉树第八层(根结点为第一层)的结点...
假定A为一个类,则语句A(A&a);为该类_...
一个模块直接调用的其他模块个数称为___...
已知一个函数的原型是: int fn(double...