Skip to main content
added 602 characters in body
Source Link
TheTechGuy
  • 1k
  • 1
  • 8
  • 16

Primitives are fundamental data types provided by the language itself. Example in C language are int, float, char data types. It is provided as fundamental part of the language.

Non primitives are user defined variables or objects. For example you can define an object which store data or you can use struct in C to define you own variables. These are not primitive because you had to define them first in order to used them.

Examples: Employee, Student, a_very_large_number_that_you_defined_yourself

Edit with more explanation and addressing the comment I think of primitive as variables that came originally with the language and not variables like String in C++ which you have to declare using the New keyword. That makes it an object so a String would not be a primitive.

Answer you comment: It probably has to do with implementation of the variable. If it was part of language core, it is primitive. If not it is not. Example is String in C++. This is not a core variable and is declared using New keyword. So it is not primitive.

Primitives are fundamental data types provided by the language itself. Example in C language are int, float, char data types. It is provided as fundamental part of the language.

Non primitives are user defined variables or objects. For example you can define an object which store data or you can use struct in C to define you own variables. These are not primitive because you had to define them first in order to used them.

Examples: Employee, Student, a_very_large_number_that_you_defined_yourself

Primitives are fundamental data types provided by the language itself. Example in C language are int, float, char data types. It is provided as fundamental part of the language.

Non primitives are user defined variables or objects. For example you can define an object which store data or you can use struct in C to define you own variables. These are not primitive because you had to define them first in order to used them.

Examples: Employee, Student, a_very_large_number_that_you_defined_yourself

Edit with more explanation and addressing the comment I think of primitive as variables that came originally with the language and not variables like String in C++ which you have to declare using the New keyword. That makes it an object so a String would not be a primitive.

Answer you comment: It probably has to do with implementation of the variable. If it was part of language core, it is primitive. If not it is not. Example is String in C++. This is not a core variable and is declared using New keyword. So it is not primitive.

Source Link
TheTechGuy
  • 1k
  • 1
  • 8
  • 16

Primitives are fundamental data types provided by the language itself. Example in C language are int, float, char data types. It is provided as fundamental part of the language.

Non primitives are user defined variables or objects. For example you can define an object which store data or you can use struct in C to define you own variables. These are not primitive because you had to define them first in order to used them.

Examples: Employee, Student, a_very_large_number_that_you_defined_yourself