structs - C AND C+ STRUCTS D r. David A. Gaitros d...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Dr. David A. Gaitros dgaitros@fsu.edu C AND C++ STRUCTS
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
C Structs Structures are aggregate types which means they are built from other types. Format struct <struct_name> { -- declaration list };
Background image of page 2
C Structs Keyword struct introduces the structure The name you give the structure must be unique. Difference structures may have member names with the same name without conflicting with other structures One structure can contain members of many different types including other structures A structure cannot contain a member of the same type as itself
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
C Structs However! A structure may contain a pointer to itself This is called a self-referential structure and it is the important basis for forming linked-list structures in C and C++ programming Each structure ends with a left bracket and a semicolon (;) A structure does not reserve space but creates a new type
Background image of page 4
Programming (OOP) C “Struct” struct Time { int hour;
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

structs - C AND C+ STRUCTS D r. David A. Gaitros d...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online