<P> This differs from C++, where classes or structs can be statically allocated or dynamically allocated either on the stack (similar to C#) or on the heap, with an explicit pointer . In C++, the only difference between a struct and a class is that the members and base classes of a struct are public by default . (A class defined with the class keyword has private members and base classes by default .) </P> <P> The general syntax for a struct declaration in C is: </P> <P> Here tag_name is optional in some contexts . </P> <P> Such a struct declaration may also appear in the context of a typedef declaration of a type alias or the declaration or definition of a variable: </P>

What is the purpose of a structure in c