[Solved] How can i declare a boolean variable in class in c++


You should have a constructor to initialize class members:

class account {
    char itemName[50];
    double actualPrice;
    bool empty;
public:
    account() : empty(false) {} // this initializes the 'empty' variable to 'false'.
    void create_account();
    void displayRecord() const;
    void drawLine3(int n, char symbol);
};

solved How can i declare a boolean variable in class in c++