October 16th, 2007, 04:55 PM
Schildt is rather notorious for being an author who writes incorrect material in an understandable manner. He is actually, however, somewhat correct in this case.
Freestanding environments are, by their nature, typically written to support applications on a specific machine type (eg specific hardware, specific operating system, etc). If one cares at all about portability, a freestanding environment will not be targeted.
Technically, some compilers that target windows development may be viewed as a hybrid of hosted and freestanding implementations (usually with compiler settings to choose which mode it operates in). For example, compilers targeting development of windows applications support winmain(), do things using the dedicated win32 API, etc are formally freestanding environments. Flick an IDE or compiler setting, however, and the compiler supports console applications(with main(), etc) so targets a hosted environment.
The requirement, with respect to main(), is that a hosted environment will support either of two forms of main() returning int as the first function called for the application. That does not prevent an implementation from supporting other entry points (eg some environments support void main() as well) but such extensions will not be used by developers who care about portability.
October 16th, 2007, 10:53 PM
Let me add somewhat to that. Perhaps 90% of all computer systems delivered today do not run in an environment that the average programmer considers typical (Windows and various Unix clones).
The "typical" keyboard, and the "typical" display are nowhere to be found. Languages like C and C++ came to fruition before these atypical "typical" systems evolved. They chose (wisely, I think) to ignore implementation specific approaches, other than by accomodating them through proprietary run-time libraries. This makes some stuff (like clearing keyboard buffers, which might not even exist) tough to implement. Dealing with those problems requires an intimate knowledge of the underlying system. Such solutions are NOT portable.
Portability in the real world is a chimera. It is somewhat like the ideal spouse -- something to be sought after, but rarely gained.
September 26th, 2009, 11:19 PM
In 0.1, please add Code::Blocks, it's my favorite IDE/compiler
Oh, and please, in the part for conversion to hex/octal, please add a description for how to do it with iomanip.
Edit: I posted this for other people's good, not my own, since I already know how to do this.
Comments on this post