I am trying to initialize a simple vector with false values and then use it. I rellized the value is never 0 or 1, so I printed it. The result is that even in the beginning it has strange big values. I am compiling with g++ (GCC) 4.4.7. The question refers to printing only vector data of type bool.
What I did:
std::vector<bool> n;
int f = 0;
for(f = 0; f<10; f++)
n.push_back(false);
for(f = 0; f<10; f++)
printf("content of %d %d",f,n[f]);
What I got:
content of 0 30572784
content of 1 30572784
content of 2 30572784
content of 3 30572784
content of 4 30572784
content of 5 30572784
content of 6 30572784
content of 7 30572784
content of 8 30572784
content of 9 30572784
What am I doing wrong?