If children don’t learnt to respect authority at school how can we expect them to respect others when they grow up?
Maybe they’ll grow up to be politicians. Then they can continue the blatant disrespect for the voting public that is so common in today’s politics.
Respect is something you earn, and very importantly it shouldn’t be confused with fear. ASBOs, fingerprinting and CCTV cameras in schools, these aren’t examples of attempts at earning respect, they are trying to strike fear into school children.
So, David, why not stand up against the current trend of sneaking in a police state through the school gates? I am convinced that kids who are treated with respect will be better behaved and respect authority… they will also make better future politicians!
But oh no! For some reason ifstream doesn’t have a constructor that accepts a standard C++ string. Instead I am forced to pass a const char * to the constructor, e.g.:
I guess that’s an excellent exmple of standardisation-by-committee where one part of the committee doesn’t have a clue what the other one is doing. Pathetic, really!
Now more stuff on ifstream. One would hope that opening a non-existing file for reading would trigger some sort of exception, at the very least reading from a non-existing file shouldn’t succeed. Oh, but not so in the wonderful world of C++. The following code compiles and executes just fine even if the file (hello.txt) doesn’t exist:
r is unmodified by inf >> r;. Even more interestingly inf.eof() returns false. Interestingly inf.bad() returns false too. Luckily inf.good()i returns false too, so there is some way of finding out that not all is well with inf. It was also pointed out that evaluating inf itself, such as in if(inf) ..., also results in false.
I can’t understand the reasonning behind having two methods, good() and bad() which aren’t each other’s opposites, their names certainly suggests they ought to be! It seems they are badly named, they should be called no_error_has_occured() and no_exceptional_failure_has_occured() respectively.[back]