Good Morning,

I am trying to create 2 arrays out of a list. Here is the code that I use:

int* move_x= new int[10];
int* move_y=new int[10];

void D::printpath(){
	int i=0;
	list<state>::iterator iter2;

	for(iter2=path.begin(); iter2 != path.end(); iter2++) {
	  cout<<"["<<iter2->x<<" , "<<iter2->y<<"]";
	 move_x[i]=iter2->x;
	 move_y[i]=iter2->y;
	  i=i+1;
	}
}

It gives an error: IntelliSense: expression must have (pointer-to-) function type.

What am I doing wrong? How should I create the arrays?

Lines 10 and 11. You are using () instead of []

thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.