KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Seems like this would be a duplicate, but maybe it is just so obvious it hasn't been asked... Is this the proper way of checking if a variable (not pointer) is initialized in a C++ class? class MyClass { void SomeMethod(); char mCharacter; double mDecimal; }; void MyClass::SomeMethod() { if ( mCharacter ) { // do something with mCharacter. } if ( ! mDecimal ) { // define mDecimal. } }
Tags (comma-separated)
Save Edits
Cancel