structs

structs - C AND C+ STRUCTS Dr. David A. Gaitros...

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 tructures are aggregate types which means they are built from other types. ormat struct <struct_name> { -- declaration list };
Background image of page 2
C Structs eyword 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 owever! 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 ach structure ends with a left bracket and a semicolon (;) structure does not reserve space but creates a new type
Background image of page 4
Introduction to Object Oriented Programming (OOP) “Struct” truct Time { int hour; int minute; int second; ; / following allocates
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 Dr. David A. Gaitros...

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