nameless_centurian
Gawd
- Joined
- Apr 4, 2003
- Messages
- 836
unfortunately, my stroustrup is a couple hours away and i am having difficulty understand the root cause of my error.
when i implement this
i get this error
from this line
i don't understand the origins of the error. i don't explicitly tell the compiler to make the conversion. why is it attempting to do so? it is obvious that i don't understand the semantics of the vector class (i'm a C programmer by nature). how can i store/iterate through a vector of pointers to objects?
when i implement this
Code:
bool funct(cell& item,vector <cell*>& x);
i get this error
error: conversion from `__gnu_cxx::__normal_iterator<cell**, std::vector<cell*, std::allocator<cell*> > >' to non-scalar type `__gnu_cxx::__normal_iterator<cell*, std::vector<cell, std::allocator<cell> > >' requested
from this line
Code:
for(vector<cell>::iterator i = x.begin(); i != x.end(); i++)
i don't understand the origins of the error. i don't explicitly tell the compiler to make the conversion. why is it attempting to do so? it is obvious that i don't understand the semantics of the vector class (i'm a C programmer by nature). how can i store/iterate through a vector of pointers to objects?