In c++, how to use class? Give me a best answer. I will wait you.

A class is a collection of properties, which can be initialised into any amount of objects. An object is an instance of a class, which has all the properties defined in the class.

To use a class:

public class MyName {
private:
int myInt;
float myFloat;
bool myBool;
public:
int getMyInt();
float getMyFloat();
bool getMyBool();
void setMyInt(int i);
void setMyFloat(float f);
void setMyBool (bool b);
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.