Guest_imported
New member
- Jan 1, 1970
- 0
Hello,
I would like to know how to setup a constructor correctly.
Is this how I set it up in a class struct?And what is a default constructor? CAn you show an example?
class blah
{
int A;
float B;
char C[30];
public:
The_Constructor(int,float,char);
void Read();
void Write();
};
The_Constructor::The_Constructor(int X,float y,char z[])
{
A=X;
B=y;
strcpy(C,z);
}
Please correct me if Im wrong. Am I doing it right?
thankx you.
I would like to know how to setup a constructor correctly.
Is this how I set it up in a class struct?And what is a default constructor? CAn you show an example?
class blah
{
int A;
float B;
char C[30];
public:
The_Constructor(int,float,char);
void Read();
void Write();
};
The_Constructor::The_Constructor(int X,float y,char z[])
{
A=X;
B=y;
strcpy(C,z);
}
Please correct me if Im wrong. Am I doing it right?
thankx you.