same the types used in C. that is int...char...float...
A primitive data type is built into the language - int, char, long, etc. A non-primitive data type is am abstract data type that is built out of primitive data types - linked list, queue, stack, etc.
C is not an object-oriented programming language and therefore has no objects as such. However, the term is often used in a more general sense to mean any instance of an user-defined or primitive variable/constant. In C++, the term is used specifically to mean any instance of a class.
C++ is only partially OOP because it is a superset of C and, for the sake of backward compatibility, retains the concept of primitive data types (such as integrals like char and int) and pointer data types, which are all strictly non-object-oriented. In Java and C#, there is no concept of a primitive data type. Even integral types such as int are treated as objects and there is no concept of a pointer data type.
A std::string is an object that encapsulates an array of type char whereas a C-style string is a primitive array with no members. A std::string is guaranteed to be null-terminated but a C-style string is not.
C++ evolved from C and therefore retains the concept of primitive variables inherited from C, including int and char. In 100% OOP languages such as Java, these primitives would be implemented as objects. But in C++, they are primitive in nature. That is, they have no built-in methods such as .ToString() associated with them.
type variable {[optional array size]} {= optional initializer};
A primitive data type is built into the language - int, char, long, etc. A non-primitive data type is am abstract data type that is built out of primitive data types - linked list, queue, stack, etc.
primitive non primitive
It is not a reserved word, so can be an identifier (name of a type/variable/function).
Basic types (primitive data types) have no methods associated with them.
An example may help: int x= 3; Here 'int' is a type, 'x' is a variable with the type, and '3' is a value of the type.
A constant is a variable that does not change. The correct term is constant variable.
C is not an object-oriented programming language and therefore has no objects as such. However, the term is often used in a more general sense to mean any instance of an user-defined or primitive variable/constant. In C++, the term is used specifically to mean any instance of a class.
C++ is only partially OOP because it is a superset of C and, for the sake of backward compatibility, retains the concept of primitive data types (such as integrals like char and int) and pointer data types, which are all strictly non-object-oriented. In Java and C#, there is no concept of a primitive data type. Even integral types such as int are treated as objects and there is no concept of a pointer data type.
I can tell you that it is not an illegal variable name in C. I do not currently have a C++ compiler installed, but I would assume that it would also be valid in C++.
A std::string is an object that encapsulates an array of type char whereas a C-style string is a primitive array with no members. A std::string is guaranteed to be null-terminated but a C-style string is not.
Not initialized variable: int myInt; Initialized variable: int myInt = 10;