Posts

Showing posts with the label sizeof

What is Data Type and variables in C? Easy explanation with real world analogy.

Image
PDF Link  Click Here for PDF PPT Link  Click Here for PPT Code Link  Click Here For Code What is Data Type? The data type is an entity that specifies, what type of data we are storing in a variable. There are mainly 2 type of data types in C: Primitive Non-primitive Enumeration (optional) Let's understand them one by one. Primitive Data Type It is the system's pre-defined or pre-declared data structure and can store only one type of value. Example: Integer, Float, Character. Non-primitive Data Type It is the user-defined data structure, which means we are the ones who will choose what and how to store our data in what manner. Example: Array, Linked list, Stack, Queue, structure, pointer, union, etc. Enumeration Data Type (optional) It is also a user-defined data type, but it is reserved for making integral constants in the C language. What is a Variable? A Variable is like a container that stores a specific type of data. You can understand easily by this example: Have you...