Struct and class Definitions

Started by
3 comments, last by TheBinaryMan 15 years ago
Is there any difference between:

struct struct1
{
};

//and

struct
{
}struct1;


Advertisement
The first one declares a struct type named struct1. The second one declares an instance of an anonymous struct type named struct1.
So you can mix the two together to define and declare an instance?
Yes, but I don't really recommend it. It's usually better to separate defining the type and defining instances.
Thanks SiCrane, been wondering about that for a while.

This topic is closed to new replies.

Advertisement