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"} };
This is a discussion on Structure or Array? within the C Programming forums, part of the General Programming Boards category; Is this an structure or an array? I think is an structure because it starts with struct, but it has ...
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).
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
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.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge