If you do not specify a memory model, Microsoft C/C++ defaults to the small model, which is adequate for many small to midsized programs.
You can select a memory model from the Programmer's WorkBench (PWB) or from the command line.
If you're compiling from the Programmer's WorkBench, pull down the Options menu and open the Language Options submenu. From that menu, open either the C or C++ Compiler Options dialog box, and select a memory model there. Choose one of the standard models or choose Customized and select the options for a customized model.
Selecting from the Command Line
You can choose a memory model by including an option on the command line. For example, to compile CLICK.C as a compact-model program, type this:
CL /AC CLICK.C
The /AC option selects the compact memory model. The six options and four libraries are as follows:
Option | Memory Model: Library |
/AT | Tiny Model: SLIBCxx.LIB (plus CRTCOM.LIB) |
/AS | Small Model: SLIBCxx.LIB |
/AM | Medium Model: MLIBCxx.LIB |
/AC | Compact Model: CLIBCxx.LIB |
/AL | Large Model: LLIBCxx.LIB |
/AH | Huge Model: LLIBCxx.LIB |