An array of struct - C++ Data Type

C++ examples for Data Type:struct

Description

An array of struct

Demo Code

typedef struct {
   int i, j, k;/* ww  w. j a v a 2s  . com*/
} ThreeDpoint;
int main() {
   ThreeDpoint p[10];
   for(int i = 0; i < 10; i++) {
      p[i].i = i + 1;
      p[i].j = i + 2;
      p[i].k = i + 3;
   }
}

Related Tutorials