C++ Class Data Members Question

Question

Write a program that defines a class called MyClass with three data members of type char, int, and bool.

Make an instance of that class inside the main function.

You can use the following code structure:

#include <iostream> 

int main() 
{ 
    //your code here
} 


class MyClass 
{ 
    char c; 
    int x; 
    bool b; 
}; 
int main() 
{ 
    MyClass o; 
} 



PreviousNext

Related