I want to do something like this with a "std::vector" object:
int main(int argc, char* argv[])
{
int *piData = new int[10];
for(int i=0; i<10; i++) piData [i] = 0;
SetDataValue(piData +5);
return 0;
}
void::SetDataValue(int *pData)
{
*pData = 1;
*pData+1 = 2;
*pData+2 = 3;
}
Here is the same thing but with a std int vector (this dosn´t work, I get this error: error C2676: binary '+' : 'class std::vector >' does not define this operator or a conversion to a type acceptable to the predefined operator):
int main(int argc, char* argv[])
{
std::vector <int> m_vData;
for(int i=0; i<10; i++) vData.push_back(0);
// Dont work. Why?
SetDataValue(m_vData+5);
return 0;
}
void::SetDataValue(int *pData)
{
*pData = 1;
*pData+1 = 2;
*pData+2 = 3;
}
Thanks,
Zeblar Nagrim, Lord of Chaos
Edited by - Zeblar Nagrim on June 30, 2001 4:30:21 PM
Edited by - Zeblar Nagrim on June 30, 2001 4:36:58 PM
Edited by - Zeblar Nagrim on June 30, 2001 4:39:51 PM