Please use code tags for code, they make code readable, otherwise the board strips out all spacing. Code tags work like [ code ] stuff [ /code ] except without the extra spaces in the tags.
I am learning about C++ and today am reading concepts for Constructor but it seems a bit difficult to grab it fully. Please anyone explain in simple words about Constructor? (1 Reply)
Hi,
If I run the following program
class A {
public:
A() { cout << "default" << endl; }
A(const A&) { cout << "copy" << endl; }
};
A tmp;
A fun() {
return tmp;
}
A test() {
A tmp;
cout << &tmp << endl;
return tmp;
} (1 Reply)
I have the following code
class Param{
public:
Param(int aa, int bb){
a=aa;
b=bb;
}
int a,b;
};
void function(Param);
int main(){
function(2,3);
return 0;
} (6 Replies)
helo i m new in c++ on linux
can u tell me with an simple example that how do you handle constructor and destructor that fail?
Regards,
Amit (4 Replies)
helo i read many books but i cant find the proper answer that why
constructor cannot be virtual
can u explain me in simple term that why constructor cannot be virtual
Regards,
Amit (2 Replies)
Hi guys I am new to these forums but since I am taking a class at college I would appreciate any help that is possible for this program. My instructor said that when its complete the program should be able to store all 3 fields instead of just 1.
public class Greeter2Test
{
public static... (4 Replies)