0

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?

Edited by Ninjah: n/a

2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by Ninjah
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.