what is the mean of function ?
题目
what is the mean of function ?
I want to know something about function in c++,and how to use it in programming !
especially in function overload!
help!
答案
A class may have several constructors, for example:
class myClass {
//constructor 1
myClass(int nx,int ny, int size){ c = nx * ny;};
//constructor 2
myClass(int nx,int ny, int nz, int size){ c = nx * ny * nz;};
.
}
When you generate instances of myClass, you may use:
myClass d2,d3;
d2.myClass(nx,ny,c);
d3.myClass(nx,ny,nz,c);
or use
d2.myClass(nx,ny,c);
.
b = a / c;
d2.myClass(nx,ny,nz,c);
.
b = a / c;
the later 2 d2.myClass() are "function overload",
one with 3 parameters and another with 4 parameters
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
最新试题
热门考点
- 火灾时身上着了火怎么办(阅读题)
- 二十世纪是从几几年到几几年?
- 已知x²-x+n可以分解为(x+3)(x-4),则n等于
- 已知,如图,四边形ABCD中DC//AB,DA垂直AB于点A,AE垂直BC于点E,且CD=CE,求证:AB=BC
- 如图,在△ABC中,AD平分∠BAC,AD的垂直平分线EF交BC的延长线于点F,连接AF,求证:∠CAF=∠B.
- 已知点M(3,2)N(0,1),点P在x轴上,且PM+PN最短,则点P坐标为
- 南腔北【 】虎离山【 】高水【 】歌当【 】笑不【 】陇忘【 】括号里填什么
- 等腰三角形的底边为16cm,腰长为10cm,则顶角平分线长为_____cm
- 描写春天天气的作文
- 英语翻译