Question

Type1 Type2

i was wondering as to what is the difference between these two definition of structures one having the structure name(Books) and its instantiation(Book) while the other has only the instantiation(complex).

Était-ce utile?

La solution

In the first version, you can declare or define variable of that type by

struct Books b;

or

Book b;

In the second version, you only can use

Complex c;

Note: both Book and Complex are type names.

Another difference, pointed out by @Rikayan Bandyopadhyay, in the first version, you can include a pointer element that can point to the same structure, which element will have type struct Books *, but you cannot do that in the second version.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top