J
JoeC
I understand the basics of pointers, they point to memory locations. I
would like to know resources for learning all about poters. I am
having some problems erasing elements of pointers from a vector. I
wold like to know where I can get some in depth information on how to
use pointers in various situations. It seems that all most books have
to say about pointers is that they point to memory locations. Some
even say they are read/write iterators for arrays. I am using pointers
refrences and handles, most of the time I get the syntax correct but I
have a problem in a complex program and I cant figure out what the
problem is:
I created a handle to contor my dynamicly binded units and I need
pointer to these handles to work in the space holder object in my map
manager for this game.
bool spaceholder::kill(){
std::vector<hunit*>::iterator itr = u.begin();
if(!u.empty()){
while(itr != u.end()){
if((*itr)->marked()){
itr = u.erase(itr);
kill = true;
}++itr;
}
}
}
would like to know resources for learning all about poters. I am
having some problems erasing elements of pointers from a vector. I
wold like to know where I can get some in depth information on how to
use pointers in various situations. It seems that all most books have
to say about pointers is that they point to memory locations. Some
even say they are read/write iterators for arrays. I am using pointers
refrences and handles, most of the time I get the syntax correct but I
have a problem in a complex program and I cant figure out what the
problem is:
I created a handle to contor my dynamicly binded units and I need
pointer to these handles to work in the space holder object in my map
manager for this game.
bool spaceholder::kill(){
std::vector<hunit*>::iterator itr = u.begin();
if(!u.empty()){
while(itr != u.end()){
if((*itr)->marked()){
itr = u.erase(itr);
kill = true;
}++itr;
}
}
}