Name
struct keyword — Declares class with public members
Synopsis
class-key := struct
The struct
keyword declares a
class that has public access by default. Inheritance is also public by
default. See class
for syntax
rules.
Example
struct
point { int x, y; };struct
point p1; // "struct" is redundant here. point p2;
See Also
class
, union
, Chapter
6
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.