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

Luu Vo vtluu@tma.com.vn
Thu Jun 3 01:47:00 GMT 2004


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.



More information about the Gcc-help mailing list