Is this an structure or an array?
I think is an structure because it starts with struct, but it has the [4] which is only in arrays :S
Code:struct part data[4] =
{
{1, "Smith"},
{2, "Jones"},
{3, "Adams"},
{4, "Wilson"}
};
Printable View
Is this an structure or an array?
I think is an structure because it starts with struct, but it has the [4] which is only in arrays :S
Code:struct part data[4] =
{
{1, "Smith"},
{2, "Jones"},
{3, "Adams"},
{4, "Wilson"}
};
A variable cannot be a struct. A struct is a type.
But yes, it's an array of 4 parts (and part is a struct type).
Does this compile on your system? It doesn't compile on my VC++ 6.0.
It should compile provided you have declared part with at least an integer-type and a string-type.