If the object represents a data type, is the variable for a primitive data type like an integer also an object representing this type, or do objects not represent primitive data types?
// Let's assume I have a class called "DifferentTypes."
class DifferentTypes {
public:
int I{};
string str{};
bool b{};
};// Sorry for my poor code writing
int main() {
DifferentTypes dfft;
dfft.I = 10;
int x{};
x = 10;
return 0;
}
New contributor
Ahmed Hamed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
11