Hello ,
I have this:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
using namespace std;
typedef struct
{
float x;
float y;
Point *next;
} Point;
int main()
{
Point *thePoints = new Point[2];
thePoints[0].x = 2;
thePoints[0].y = 3;
thePoints[1].x = 4;
thePoints[1].y = 5;
(thePoints[0])->next= 11;
cout << (thePoints[0]->next <<endl;
return 0;
}
but at the last 2 lines I can't access (thePoints[0])->next
. (base operand of ‘->’ has non-pointer type ‘Point’)
I can't undestand why!