C:\Users\Kostya\Desktop\c++\MacroWriter\ifexists.cpp|27|error: ambiguous overload for 'operator=' in '((farm*)this)->farm::sendeachbase = 0'|
Ok so I am making a class for my program and I want to initialize some of its variables to 0's. I haven't done anything with classes for a while so I am not good with this stuff.
This is my code:
class someclass
{
public:
string coords;
int basen;
string sendtoeach[5];
someclass() { // my constructor
int i = 0;
while(i<5) {
sendtoeach[i] = 0;
i++;
}
}
};
This doesnt work and it gives me an error above. What did I do wrong and how do I initialize some variables of a class to 0 if I need to. And also do you know if code::blocks initializes all the variables in the class to 0's because then it will help a lot and I will not need that stupid constructor.