[Dev-C++] Re: Buggy standard library?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Kevin B. <kev...@ma...> - 2004-04-13 16:49:19
|
It's a bad idea to assume that library code is "buggy" just because it doesn't do what you expect. In fact, the standard library is a carefully designed and extensively tested chunk of code. It is highly unlikely that a beginner poking at it in obvious (if naive) ways is going to discover a "bug" that has escaped legions of testers and developers. It is far more likely that the person in question simply doesn't understand how things work in C++, and has written their own bug. That is indeed the case here. This program is working exactly as specified in the C++ standard. The destructor for global objects are called *after* the main() function has exited. Standard I/O is not guaranteed to work at that time, although it might. Even if it does, though, since it will happen after the system() call in any case, you might well simply not notice it before the console window disappears. --- Kevin |