title: Why does it give an error when compiling the project:
body: <p>I need to display an array of structures, as far as I understand, I need to use a memory shift, having a pointer to the first element of the array. When trying to fix the code, we saw the following error:</p>
  <blockquote>
  <p>Invalid types ‘[int]’ for array subscript</p>
  </blockquote>
  <p>my code:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string.h&gt;
  using namespace std;
  
  typedef struct Point3D{
      double x;
      double y;
      double z;
  }Point3D;
  
  Point3D createPoint3D(double xnum, double ynum, double znum){//функція створення точки
      Point3D point;
      point.x = xnum;
      point.y = ynum;
      point.z = znum;
      return point;
  }
  
  void PrintPoint(Point3D point){//використовується в інщій ф-ції, по суті внутрішня не основна функція
      cout &lt;&lt; &quot;(&quot; &lt;&lt; point.x &lt;&lt; &quot;,&quot;&lt;&lt; endl;
      cout &lt;&lt; point.y&lt;&lt; &quot;,&quot;&lt;&lt; endl;
      cout &lt;&lt; point.z&lt;&lt; &quot;;&quot;&lt;&lt; &quot;\n&quot;&lt;&lt; endl;
      }
  
  
  
  class Obj3D{
  private:
  
        Point3D *array_of_points;
        int number_of_points;
  public:
          void setAddPoint(Point3D point){
              *(array_of_points + sizeof(point)*number_of_points) = point;
              number_of_points++;}
  
          int getNumber(){
              return number_of_points;}
  
          Point3D *getArray(){
          return array_of_points;}
  
          Obj3D(Point3D point, int number){
          number--;
          *(array_of_points + number) = point;}
  
          Obj3D(){
          *array_of_points = createPoint3D(0.0, 0.0, 0.0);
          number_of_points = 1;
          }
  
          ~Obj3D(){}
  };
  
         void printObj(Obj3D Obj){
             for(int x = 0; x&lt;=Obj.getNumber(); x++){
              PrintPoint(Obj.getArray()[x]);
             }
         }
  
  
  int main(int argc, char* argv[]){
      Obj3D Obj;
      Point3D point1 = createPoint3D(-0.5,-0.5,-0.5);
      Point3D point2 = createPoint3D(0.5,-0.5,-0.5);
      Point3D point3 = createPoint3D(-0.5,-0.5,0.5);
      Point3D point4 = createPoint3D(0.5,-0.5,0.5);
      Point3D point5 = createPoint3D(0.0,0.5,0.0);
      Obj.setAddPoint(point1);
      Obj.setAddPoint(point2);
      Obj.setAddPoint(point3);
      Obj.setAddPoint(point4);
      Obj.setAddPoint(point5);
      cout&lt;&lt;Obj.getArray();
      exit(0);
  }
  </code></pre>
  <p>You can not watch the main function, it is most likely not correct, I want to deal with the functions of the output and set</p>