![]() |
VOOZH | about |
Data types in the C language can be categorized into three types, namely primitive, user-defined, and derived data types. In this article, we shall learn about derived data types.
In C, the data types derived from the primitive or built-in data types are called Derived Data Types. In other words, the derived data types are those data types that are created by combining primitive data types and other derived data types.
There are three derived data types available in C. They are as follows:
We shall learn about each of these data types one by one.
A function is called a C language construct which consists of a function-body associated with a function-name. In every program in C language, execution begins from the main function, which gets terminated after completing some operations which may include invoking other functions.
return_type function_name(data_type param1, data_type param2, ...);
15
For more details about Functions in C, please refer to this article.
Array in C is a fixed-size collection of similar data items stored in contiguous memory locations. An array is capable of storing the collection of data of primitive, derived, and user-defined data types.
data_type array_name [size];
18 36 54 3.140000 6.280000 9.420000
Following are some defining properties of arrays in C
For more details about Arrays in C, please refer to this article.
A pointer in C language is a data type that stores the address where data is stored. Pointers store memory addresses of variables, functions, and even other pointers.
data_type *ptr_name;
where,
Value at myPtr = 0x7ffd0850df9c Value at var = 20 Value at *myPtr = 20
For more details about Pointers in C, please refer to this article.