题目
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!
I want to know something about function in c++,and how to use it in programming !
especially in function overload!
help!
提问时间:2020-07-27
答案
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
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的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1Mike has some new books.改为一般疑问句 __Mike have __ new books
- 2He failed his math examination because of his careless.
- 3为什么数学老师6道很简单的计算题可以讲50分钟
- 4It ____ my mother ten cents to buy the book?能填cost吗?
- 5一,由肯定句变为一般疑问句
- 6你吃过手拉面吗?如果把一个面团拉开,然后对折,再拉开,在对折...如此下去对折十次,
- 7按要求填空.补充成语
- 8the way the water molecule is formed gives water its unique properties.
- 9用风的不同意思组词 1.当"消息"讲 2.当“没有确实的根据”
- 10设多项式f(x)除以(x-1)的余式为2,除以(x^2-2x+3)的余式为(4x+6),则f(x)除以(x-1)(x^2-2x+3)的余式是多少?
热门考点
- 1火灾时身上着了火怎么办(阅读题)
- 2二十世纪是从几几年到几几年?
- 3已知x²-x+n可以分解为(x+3)(x-4),则n等于
- 4已知,如图,四边形ABCD中DC//AB,DA垂直AB于点A,AE垂直BC于点E,且CD=CE,求证:AB=BC
- 5如图,在△ABC中,AD平分∠BAC,AD的垂直平分线EF交BC的延长线于点F,连接AF,求证:∠CAF=∠B.
- 6已知点M(3,2)N(0,1),点P在x轴上,且PM+PN最短,则点P坐标为
- 7南腔北【 】虎离山【 】高水【 】歌当【 】笑不【 】陇忘【 】括号里填什么
- 8等腰三角形的底边为16cm,腰长为10cm,则顶角平分线长为_____cm
- 9描写春天天气的作文
- 10英语翻译