Jump to content

C++ Language/Variables/DefineAtSameTimeAsType

From Wikibooks, open books for an open world

Programmers usually define a class (class CRType {...};) separately from using that class' name in an object's definition (a subsequent CRType oObject; statement). However, it is possible to combine these into a single codeline (class CRType {...} oObject;).

Additional information about defining a variable at the same time as a type