13.07.2015 Views

C struct, typedef, enum & union - Tenouk C & C++

C struct, typedef, enum & union - Tenouk C & C++

C struct, typedef, enum & union - Tenouk C & C++

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

STRUCT, TYPEDEF, ENUM & UNIONStructure (<strong>struct</strong>)• With array, we can only declare one data type per array.• For different data type, we need another arraydeclaration.• It is single type aggregate data type.• Struct overcomes this problem by declaring compositedata types which can consist different types.• A <strong>struct</strong>ure is a collection of related data items stored inone place and can be referenced by more than onenames.• These data items are different basic data types. So, th<strong>enum</strong>ber of bytes required to store them may also vary.• A <strong>struct</strong>ure type is a user-defined composite type.• It is composed of fields or members which can bedifferent types.www.tenouk.com, © 2/93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!