C/C++ Syntax Reference - Declaring Pointers to StructsDeclaring a Pointer to a StructThe syntax for declaring struct instances in C and C++ differs. In C, if you do not typedef the struct, you must precede the name of struct type the keyword struct. In C++, this is not required. In either case, to declare a pointer to a struct, you simply precede the name of the instance with a *.In C++: struct_name *struct_instance;In C: struct_name_t *struct_instance; /* struct_name_t must be a typedef */or struct struct_name *struct_instance; |