Bool initialization in class
Hey!
I've got a class with a private bool isScanning, and I'm trying to set it to false when initializing it in the class:
Code:
class blah
{
public:
function1();
function2();
private:
bool isScanning = false;
};
I feel so stupid for not knowing why, but why would GCC give me:
Quote:
ISO C++ forbids initialization of member `isScanning'
I could have sworn you were allowed to set a value for variables in classes, no? I know I've done it in the past...
Thanks!
FlyingIsFun1217