T
Tommy Lang
I have created my own class called MyClass.
I then have created three instances/variables of the class in main...
int main(){
MyClass One;
MyClass Two;
MyClass Three;
//In the constructor of the class I have given all the above variables
a value.
//I want to call a function that calculates and return the sum, like
this:
Three = One.Add(Two); //function Add returns a double
.......
But I end up getting an error saying that...... Add' : cannot convert
parameter 1 from 'class MyClass' to 'double'
How do I avoid this error??
Does anyone know what I am doing wrong? Tips??
Thanks,
T
I then have created three instances/variables of the class in main...
int main(){
MyClass One;
MyClass Two;
MyClass Three;
//In the constructor of the class I have given all the above variables
a value.
//I want to call a function that calculates and return the sum, like
this:
Three = One.Add(Two); //function Add returns a double
.......
But I end up getting an error saying that...... Add' : cannot convert
parameter 1 from 'class MyClass' to 'double'
How do I avoid this error??
Does anyone know what I am doing wrong? Tips??
Thanks,
T