what are structured data types give an exampleSolutionDefin
what are structured data types ? give an example
Solution
Definition of structured data types:
A structure is a user defined data type that groups logically related data items of different data types into a single unit.All the elements of a structure are stored at contiguous memory locations. A variable of structure type can store multiple data items of different data types under the one name.As the data of contact_information thst is firstname, lastname,homephone, mobilephone are structured data types
Syntax:
struct name_of_the_structure
{
type_1 field_name1;
type_2 field_name2;
...
type_N field_nameN;
};
Example:
struct contact_information
{
char firstname[FIRST_SIZE];
char lastname[LAST_SIZE];
unsigned int homephone;
unsigned int mobilephone;
};
