DEV Community

Cover image for 🎨 Primitive Data Types are like Primary Colors for creating Non-Primitive Data Types 🎨
ahseya03
ahseya03

Posted on

🎨 Primitive Data Types are like Primary Colors for creating Non-Primitive Data Types 🎨

"When you mix any of the primary colors: red, yellow, blue. it results in a secondary color. Similarly, when you mix Primitive Data type, it results in a Non-Primitive Data type."- Ayesha Mahmood

Example:
An example of a primitive data type is "char". A char is a C++ data type used for the storage of a single letter. For eg. we have the char "H" as the primitive data type. So when we mix and combine the primary primitive data type i.e. char "H" with other letters like "e", "l", "l, "o". It results in a string "hello" which is a Non-Primitive data type. Hence we see that we can similarly in this manner mix other primitive data types to create secondary Non- Primitive Data Types.
Image description
Previous Post: Importance of Data Structure in Computer Science

Top comments (0)