|
From: Carlos d. M. <cg...@wo...> - 2002-08-08 18:35:50
|
> Great! As you see it was not a compiler's issue. Great! Yes! Now I've found and reviewed one piece of code which has the for(int i) I said it didn't work. It is an author error (author of some code example I used). The ANSI about declaring for is something like "you can declare inside a for statement in the way (int i = 0[...]), but you can't use it later outside it, if you want you have to declare it just before the for: int i; for(i=0[...]) or redeclare it". I read first C/C++, an old edition and centered in C, so it said nothing about possibility of declaring in the for. Later I bought the "C++ how to program" (which couple of inexactitudes I found, some misleading things about bitfields, I suspect are due to the translator (I bought it in spanish) who knows bad spanish (!!!)), but I knew for, and I only noticed "can be declared in", but not read "out of it it is out of scope". And later I got some code examples from some sites (I don't remember where) where they were used later, and that misled me, thinking that the error wasn't only outside, but inside, too. It's a bad thing that the last for/while rare thing is deleted. I would see a possibly frequent error. (or you a compiler strange behavior, hehehehe) and I would learn to see a error now I am unable to see (Feel I need a phrase about the sea being free). Greets. |