CC++ NOTES Algorithm Data Strs

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

- Variable sized array cannot be initialized by taking input on array size from the

user

- User defined data types- Using STRUCTURES- disimilar data types grouped into one
- eg;
Struct Rectangle {
int length; --- 2 bytes
int breadth; --- 2 bytes
};
---- Total - 4 Bytes memory; currently unassigned it is not
taking any memory but when defined, it does take memory space
int main()
{
Struct Rectangle r ; ------ creates a rectangle variable r that
takes memory of 4 bytes.
Struct Rectangle r = {10, 5} --- Declaration and initialization
}
r.length = 15; --- accessing a member using a dot operator and
modification of the data

You might also like