Professional Documents
Culture Documents
CC++ NOTES Algorithm Data Strs
CC++ NOTES Algorithm Data Strs
CC++ NOTES Algorithm Data Strs
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