This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

vector and iterator in gcc/g++ C++ library


Could you please tell me why the following lines of code don't compile with
g++ in Redhat Linux 9 while they compile OK with Ms VC++ 6

#include <vector>

int main() {
    vector<int>::iterator it;
    int *pi;

    pi = it;               //error
    pi = (int *) it;       //error

    return 0;
}

Any help will be appreciated.
Thanks,

Luu Vo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]