home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / msc / qcupr.txt < prev   
Encoding:
Text File  |  2013-11-08  |  120.7 KB  |  3,030 lines

  1.  Microsoft  QuickC  Compiler - UP AND RUNNING
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  ────────────────────────────────────────────────────────────────────────────
  11.               Microsoft (R) QuickC (R) Compiler - UP AND RUNNING
  12.  
  13.                                  VERSION 2.5
  14.  ────────────────────────────────────────────────────────────────────────────
  15.  
  16.  
  17.                             MICROSOFT CORPORATION
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  Information in this document is subject to change without notice and does
  27.  not represent a commitment on the part of Microsoft Corporation. The
  28.  software described in this document is furnished under a license agreement
  29.  or nondisclosure agreement. The software may be used or copied only in
  30.  accordance with the terms of the agreement. It is against the law to copy
  31.  the software on any medium except as specifically allowed in the license or
  32.  nondisclosure agreement. No part of this manual may be reproduced or trans-
  33.  mitted in any form or by any means, electronic or mechanical, including
  34.  photocopying and recording, for any purpose without the express written
  35.  permission of Microsoft.
  36.  (C) Copyright Microsoft Corporation, 1988, 1990. All rights reserved.
  37.  
  38.  
  39.  Printed and bound in the United States of America.
  40.  
  41.  
  42.  Microsoft, MS, MS-DOS, CodeView, and QuickC are registered
  43.  trademarks of Microsoft Corporation.
  44.  
  45.  Amdek is a registered trademark of Amdek Corporation.
  46.  
  47.  BRIEF is a registered trademark of UnderWare, Inc.
  48.  
  49.  COMPAQ is a registered trademark of Compaq Computer Corporation.
  50.  
  51.  Epsilon is a trademark of Lugaru Software, Inc.
  52.  
  53.  Hercules is a registered trademark of Hercules Computer
  54.  Technology.
  55.  
  56.  IBM is a registered trademark of International Business
  57.  Machines Corporation.
  58.  
  59.  Norton Guides is a trademark of Peter Norton Computing.
  60.  
  61.  WordStar is a registered trademark of MicroPro International
  62.  Corporation.
  63.  
  64.  Document No. SY10424-0290
  65.  OEM D703-2Z
  66.  10 9 8 7 6 5 4 3 2 1
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  Table of Contents
  74.  ────────────────────────────────────────────────────────────────────────────
  75.  
  76.  
  77.  
  78.  Introduction
  79.       Read This Manual First
  80.       Features New to Version 2.5
  81.  
  82.  Chapter 1  Unpacking QuickC(R)
  83.  
  84.       System Requirements
  85.       The QuickC Package
  86.  
  87.  Chapter 2  Installing QuickC
  88.  
  89.       A Quick Overview
  90.       Running SETUP
  91.              SETUP Stage One
  92.              SETUP Stage Two
  93.              SETUP Stage Three
  94.  
  95.  Chapter 3  Using QuickC
  96.  
  97.       The QuickC Environment
  98.       Using Windows and Menus
  99.              Getting Started
  100.              Using the Mouse and Keyboard
  101.              Windows
  102.              Menus
  103.              Dialog Boxes
  104.       Using the Editor
  105.              Moving Around in a Source File
  106.              Customizing the Editor
  107.              Using Another Editor
  108.       Compiling and Linking
  109.              Building within the QuickC Environment
  110.              Building from Multiple Source Files
  111.              Compiling and Linking from the Command Line
  112.       The Debugger
  113.  
  114.  Chapter 4  Getting Help
  115.  
  116.       Structure of the Microsoft Advisor
  117.       Navigating through the Microsoft Advisor
  118.              Using the Help Menu
  119.              Using the F1 Key
  120.              Using Hyperlinks
  121.              Using Help Windows and Dialog Boxes
  122.              Accessing Different Types of Information
  123.  
  124.  Chapter 5  Where to Go from Here
  125.  
  126.  
  127.  Appendix A  Editor Functions
  128.  
  129.  
  130.  Appendix B  QuickC Differences
  131.  
  132.       QuickC Version 2.0 Additions
  133.       QuickC Version 2.5 Additions and Changes
  134.              Interface and Environment Changes
  135.              Language and Compiler Changes
  136.  
  137.  
  138.  Introduction
  139.  ────────────────────────────────────────────────────────────────────────────
  140.  
  141.  Welcome to the Microsoft(R) QuickC(R) Compiler version 2.5, a powerful and
  142.  sophisticated yet easy-to-use integrated environment for writing programs in
  143.  the C language.
  144.  
  145.  In recent years, the popularity of C has grown tremendously. C programs
  146.  often can be ported from one computer to another. C programs are fast. C
  147.  source code is compact and concise. The language encourages, but does not
  148.  enforce, modular and structured programming styles. For these and other
  149.  reasons, many programmers and professional software developers prefer C to
  150.  any other language.
  151.  
  152.  Microsoft QuickC combines the power of C with an environment that makes C
  153.  easy to learn and to use. You can write code, compile and link it, run the
  154.  program, and debug it, all without leaving the QuickC environment.
  155.  
  156.  
  157.  Read This Manual First
  158.  
  159.  This manual contains all the information you need to install and begin using
  160.  QuickC on your computer. There are five chapters:
  161.  
  162.  Unpacking QuickC - Chapter 1 lists the system requirements (hardware that
  163.  you provide) and the contents of this package (software and documentation
  164.  that we provide).
  165.  
  166.  Installing QuickC - Before you can start using QuickC, you must install it.
  167.  Although the installation process is quick and easy, you may want more
  168.  information about libraries and memory models. Chapter 2 guides you through
  169.  installation and provides answers to commonly asked questions.
  170.  
  171.  Using QuickC - Chapter 3 explains how to run QuickC and introduces the
  172.  window and menu environment. Next, it presents an example of a typical
  173.  development cycle: writing, compiling, linking, running, and debugging a
  174.  short program.
  175.  
  176.  Getting Help - The Microsoft QuickC Advisor (online help) provides important
  177.  reference information at the click of a button or press of a key. Chapter 4
  178.  illustrates the many facets of QuickC's powerful online help system.
  179.  
  180.  Where to Go from Here - Once you have unpacked QuickC, installed it on your
  181.  system, and compiled a sample program, you will probably want to investigate
  182.  QuickC further. Chapter 5 provides some suggestions on what to do next.
  183.  
  184.  
  185.  Features New to Version 2.5
  186.  
  187.  If you have used an earlier version of QuickC, you'll find a variety of new
  188.  features in version 2.5. These features include
  189.  
  190.  
  191.    ■   Language compatibility with Microsoft C version 6.0
  192.  
  193.    ■   Increased ANSI standard C compatibility
  194.  
  195.    ■   Support for the tiny memory model (.COM files)
  196.  
  197.    ■   Enhanced C for Yourself
  198.  
  199.    ■   New Quickwatch debugging feature
  200.  
  201.    ■   Customized color window support
  202.  
  203.  
  204.  For a comprehensive list of new features, refer to Appendix B.
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  Chapter 1  Unpacking QuickC(R)
  212.  ────────────────────────────────────────────────────────────────────────────
  213.  
  214.  You're probably eager to install the QuickC Compiler immediately. But you
  215.  should first take a few minutes to make sure your system meets minimum
  216.  requirements and to determine that your package is complete.
  217.  
  218.  
  219.  System Requirements
  220.  
  221.  QuickC requires the following minimum configuration:
  222.  
  223.  
  224.    ■   An IBM(R) Personal Computer or compatible running DOS version 2.1 or
  225.        later.
  226.  
  227.    ■   One hard-disk drive and one floppy-disk drive.
  228.  
  229.    ■   448K (kilobytes) of available memory (512K is recommended for medium
  230.        to large projects).
  231.  
  232.  ────────────────────────────────────────────────────────────────────────────
  233.  NOTE
  234.  
  235.  Microsoft documentation uses the term "DOS" to refer to both the Microsoft
  236.  and the IBM Disk Operating Systems (MS-DOS(R) and PC-DOS).
  237.  ────────────────────────────────────────────────────────────────────────────
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  The QuickC Package
  244.  
  245.  Check your QuickC package to see if everything is there. If any pieces are
  246.  missing, contact the retailer from whom you bought QuickC. In the package,
  247.  you should find the following items:
  248.  
  249.  Registration card: there are many advantages to being a registered owner of
  250.  QuickC version 2.5, including notification of future software releases and
  251.  easy access to customer assistance. Please take the time to fill out and
  252.  mail the registration card now.
  253.  
  254.  Disks: eight 5.25-inch floppy disks or four 3.5-inch floppy disks. The
  255.  distribution disk labeled "Setup" contains a file named PACKING.LST that
  256.  lists the location and description of all disk files in the Microsoft QuickC
  257.  package.
  258.  
  259.  Up and Running: the book you're reading now. It explains how to install and
  260.  use QuickC.
  261.  
  262.  C for Yourself: this book is written for programmers who know at least one
  263.  language (such as BASIC or Pascal) but who don't know C. Part 1, "Learning
  264.  C," is a tutorial that explains how to program in C. Many examples are
  265.  included. Part 2, "Using C," examines further the library functions that
  266.  perform input and output, the functions that create graphics, and new
  267.  features such as real coordinate graphics, presentation graphics, fonts, and
  268.  in-line assembly. The appendixes summarize the C language and QuickC library
  269.  functions.
  270.  
  271.  Microsoft QuickC Tool Kit: this book explains the individual tools and
  272.  utilities that accompany QuickC. Beginners probably won't need to refer to
  273.  this book while they're learning the fundamentals of C. Advanced C
  274.  programmers should turn to this book for detailed information about
  275.  compiling, linking, creating libraries, maintaining multiple-module
  276.  programs, and more.
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  Chapter 2  Installing QuickC
  284.  ────────────────────────────────────────────────────────────────────────────
  285.  
  286.  This chapter tells you how to install the QuickC Compiler on your system.
  287.  The SETUP.EXE program on the Setup distribution disk performs the
  288.  installation.
  289.  
  290.  SETUP.EXE does two things. First, it copies several programs (the compiler,
  291.  the linker, the library manager, the help system, and others) from the
  292.  distribution disks to your hard disk. Second, it creates one or more
  293.  combined libraries. You can't program in C without a library.
  294.  
  295.  This chapter also explains why it's necessary to build combined libraries
  296.  and how the components fit together.
  297.  
  298.  If you follow the instructions, when you finish the chapter you'll have a
  299.  working version of QuickC on your system and you'll be ready to start
  300.  programming in C.
  301.  
  302.  
  303.  A Quick Overview
  304.  
  305.  There are four steps to installing QuickC:
  306.  
  307.  
  308.    1.  Make backup copies of all distribution disks.
  309.  
  310.    2.  Read the first section of the README.DOC file for information on
  311.        installing QuickC. If there are any corrections to this book, they're
  312.        listed at the beginning of README.DOC.
  313.  
  314.    3.  Run SETUP.EXE, which is an interactive program. The questions you
  315.        answer determine the QuickC environment that is installed. Default
  316.        answers are listed in brackets. At the bottom of each screen is a
  317.        brief synopsis of what each question means.
  318.  
  319.    4.  Adjust your system and environment variables. SETUP.EXE creates two
  320.        files: NEW-VARS.BAT and NEW-CONF.SYS. Add the information from the
  321.        NEW-VARS.BAT file to your AUTOEXEC.BAT file. If you'd prefer not to
  322.        make the changes permanent, you can run NEW-VARS.BAT as a batch file.
  323.        Change your CONFIG.SYS file if the  files  value and  buffers  value
  324.        are currently smaller than the values in NEW-CONF.SYS. After modifying
  325.        these files, reboot.
  326.  
  327.  
  328.  The process is not difficult and each screen provides helpful guidance. If
  329.  you have enough DOS and programming experience to complete these four steps
  330.  without further assistance, we encourage you to do so. (If you get stuck,
  331.  return to this chapter.) You may then skip ahead to Chapter 3, "Using
  332.  QuickC."
  333.  
  334.  ────────────────────────────────────────────────────────────────────────────
  335.  NOTE
  336.  
  337.  If you make a mistake during the setup process, just run the program again.
  338.  SETUP.EXE never erases files from the distribution disks.
  339.  ────────────────────────────────────────────────────────────────────────────
  340.  
  341.  
  342.  Running SETUP
  343.  
  344.  Before you run SETUP, back up the distribution disks using the DOS COPY
  345.  command or the DISKCOPY program. Then read the first part of the README.DOC
  346.  file by loading it into a word processor or by using the TYPE command:
  347.  
  348.    TYPE README.DOC | MORE
  349.  
  350.  When you are ready to install QuickC, insert the Setup disk in drive A and
  351.  then change to that drive (type  A: ). At the DOS command line, type
  352.  
  353.    SETUP
  354.  
  355.  ────────────────────────────────────────────────────────────────────────────
  356.  NOTE
  357.  
  358.  The following instructions assume that you plan to install QuickC on a
  359.  system that has at least one floppy-disk drive and one hard-disk drive.
  360.  ────────────────────────────────────────────────────────────────────────────
  361.  
  362.  
  363.  Correcting Mistakes
  364.  
  365.  Each setup screen ends by asking if you want to change any of the options.
  366.  If you press Y, you can correct any of the answers you entered.
  367.  
  368.  To exit the SETUP program at any time, press CTRL+C.
  369.  
  370.  
  371.  Understanding Libraries
  372.  
  373.  Compared to other programming languages, C is very lean. It contains only a
  374.  few dozen keywords and operators. To print something on the screen, for
  375.  example, you call the printf function, which is not a keyword or an
  376.  operator. It's not included in the C language proper. Strictly speaking,
  377.  printf is a "library function."
  378.  
  379.  When you link a program, the linker looks in the current library for any
  380.  functions that were not defined in the program. If your source file calls
  381.  printf, for example, the linker looks in the library for the machine code
  382.  that executes the function, adds it to the executable program, and resolves
  383.  any references to printf.
  384.  
  385.  A library, then, is just a set of commonly used functions that have been
  386.  gathered into one place. The American National Standards Institute (ANSI)
  387.  defines a great number of library functions (including printf). Microsoft
  388.  QuickC adds even more. In C, the keywords and operators number in the
  389.  dozens, while the library functions number in the hundreds. Incidentally,
  390.  you can add your own heavily used functions to the library (or combine them
  391.  into a separate library) if you wish. See Microsoft QuickC Tool Kit for more
  392.  information on using the Library Manager (LIB.EXE).
  393.  
  394.  One of the key jobs performed by SETUP.EXE is building at least one large
  395.  "combined library." Individual smaller parts of the library are called
  396.  "component libraries." The two component libraries you must have are the
  397.  memory model library and the math package library. The two additional
  398.  component libraries containing graphics functions are optional.
  399.  
  400.  You'll ultimately use one of the combined libraries when you compile and
  401.  link a program.
  402.  
  403.  
  404.  SETUP Options
  405.  
  406.  SETUP has two options for shortcuts: /H and /L. You should not use these
  407.  options the first time you run SETUP.
  408.  
  409.  Use the /L option after you have already installed QuickC and you want to
  410.  build additional combined libraries without going through the entire setup
  411.  process.
  412.  
  413.  Combined libraries are described above (see "Understanding Libraries"). If
  414.  you wish to add more libraries in the future, use the /L option:
  415.  
  416.    SETUP /L
  417.  
  418.  The /H option suppresses the SETUP help information sent to the screen. If
  419.  you install QuickC again, you can bypass the help information by using the
  420.  /H option:
  421.  
  422.    SETUP /H
  423.  
  424.  
  425.  SETUP Stage One
  426.  
  427.  Before SETUP can install QuickC, it needs some information about your system
  428.  and the type of programming you intend to do. This first stage of SETUP is a
  429.  series of questions split into three screens.
  430.  
  431.  
  432.  First Screen: The Libraries
  433.  
  434.  The first screen asks these questions:
  435.  
  436.    Source of disk images [A:]:
  437.    Math Options: Emulator [Y]:8087 [N]:
  438.    Memory Models:Small[Y]:Medium[N]:Compact[N]:Large[N]:
  439.    Delete the component libraries when finished [Y]:
  440.    Include in combined libraries: GRAPHICS.LIB [N]:PGCHART.LIB [N]
  441.  
  442.    Do you want to change any of the above options [Y]:
  443.  
  444.  The questions appear on the screen one at a time. An explanation of each
  445.  option appears at the bottom of the screen, unless you added the /H option
  446.  when you ran SETUP. Answer the questions by typing in your responses and
  447.  pressing ENTER.
  448.  
  449.  Each question ends with a default answer inside square brackets ([Y], for
  450.  example). Press ENTER to accept the default. If you are unsure of the proper
  451.  reply for any of these questions, consider the default a good place to
  452.  start. If you later find you would have preferred to make another choice,
  453.  you can always run SETUP again.
  454.  
  455.  Each screen concludes by asking if you want to change any of your choices.
  456.  When you're satisfied, press N (the default answer is Y, which returns you
  457.  to the first question on the screen). If you start over, the default answers
  458.  become the choices you made previously.
  459.  
  460.  
  461.  Which Disk Drive?
  462.  
  463.  The first question on the first screen asks where you're starting from (the
  464.  drive containing the distribution disks):
  465.  
  466.    Source of disk images [A:]:
  467.  
  468.  
  469.  Which Math Library?
  470.  
  471.  Your answer to the second question determines which math component libraries
  472.  will be included in the combined library:
  473.  
  474.    Math Options: Emulator [Y]:    8087 [N]:
  475.  
  476.  Some computers contain an 8087 or 80287 math coprocessor chip and some
  477.  don't.
  478.  
  479.  If your machine is equipped with a coprocessor, linking your programs with
  480.  the combined library tailored for the 8087 will speed up all floating-point
  481.  calculations. However, these programs will run only on a machine that has an
  482.  8087 or 80287 chip.
  483.  
  484.  Programs linked with the emulator library, on the other hand, will run on
  485.  any computer, whether it has a coprocessor or not. The emulator library does
  486.  check for the presence of a math coprocessor. If the computer has a
  487.  coprocessor, it performs all floating-point math operations. If no
  488.  coprocessor is installed, the emulator library "emulates" (imitates) the
  489.  actions of a coprocessor.
  490.  
  491.  If you're not sure which math library to include, choose the emulator
  492.  library because it's the most flexible.
  493.  
  494.  You may include both math libraries, but doing so doubles the number of
  495.  combined libraries SETUP builds, thus doubling the time it takes to install
  496.  QuickC. If you intend to install all possible library configurations, you'll
  497.  need approximately 6 megabytes of available space on your hard disk. If you
  498.  install just one library, you'll need about 2.7 megabytes of free space.
  499.  
  500.  
  501.  Which Memory Model?
  502.  
  503.  The next question asks which memory models you plan to use:
  504.  
  505.    Memory Models: Small [Y]:   Medium [N]:   Compact [N]:   Large [N]:
  506.  
  507.  The small memory model is the default. If you're in a hurry to install
  508.  QuickC, accept the default answer by pressing ENTER four times and bypass
  509.  the explanation below. Should you discover that you need additional memory
  510.  for your programs, you can run the SETUP program again. If you're curious
  511.  about memory models, read on.
  512.  
  513.  The 8086 processor and its relatives access memory in 64K blocks called
  514.  "segments." To move outside of the current 64K segment requires additional
  515.  machine instructions. Also, an address within the 64K segment can be
  516.  specified with only two bytes. If you wish to access more than 64K of memory
  517.  locations, their addresses must include additional bytes (which makes
  518.  pointer variables longer and program execution slower).
  519.  
  520.  C programs have two parts: the code (machine instructions) and the data
  521.  (variables and constants). If you write programs that fit either the code or
  522.  the data entirely within one 64K segment of memory, the program will execute
  523.  faster and use less memory. However, if you need to use multiple memory
  524.  segments for the code or the data, you may, although the program will run
  525.  more slowly.
  526.  
  527.  The various configurations of memory usage are called "memory models."
  528.  QuickC supports six standard memory models. Table 2.1 illustrates the
  529.  relationship between the six available memory models and the limits placed
  530.  on their code and data segments.
  531.  
  532.  Table 2.1  Memory Models
  533.  
  534. ╓┌─────────────┌────────────────────────┌────────────────────────────────────╖
  535.  Memory Model  Code Segment Limit       Data Segment Limit
  536.  ────────────────────────────────────────────────────────────────────────────
  537.  Tiny          64K total Code and Data  ─
  538.  Small         64K                      64K
  539.  Medium        None                     64K
  540.  Compact       64K                      None
  541.  Large         None                     None
  542.  Huge          None                     None
  543.  ────────────────────────────────────────────────────────────────────────────
  544.  
  545.  
  546.  For a great many applications, the small memory model suffices. The tiny
  547.  memory model is similar to the small model except it is limited to 64K per
  548.  program (including both code and data) and it produces .COM files instead of
  549.  .EXE files. If you're working on a large database manager, you might want
  550.  one of the models that provides unlimited data segments (compact, large, or
  551.  huge). If you're writing a program with many functions, you might want to
  552.  remove the limit on the code segment (medium, large, or huge).
  553.  
  554.  The huge memory model uses the same library as the large model, so the SETUP
  555.  program offers only four choices. The difference between large and huge is
  556.  that
  557.  
  558.  the huge model allows individual arrays to exceed 64K, whereas the large
  559.  model limits arrays to 64K.
  560.  
  561.  Any or all of these memory models may be selected, but SETUP.EXE will build
  562.  a separate combined library for each model. For example, if you choose the
  563.  small memory model and the math emulator, the library file SLIBCE.LIB is
  564.  created. If you choose the medium model and the 8087 math package,
  565.  MLIBC7.LIB is created. The small memory model libraries start with the
  566.  letter "S," medium with "M," compact with "C," and large with "L."
  567.  Similarly, the emulator math package is shown by a final "E" in the file
  568.  name, the 8087 package by a "7."
  569.  
  570.  Given four memory models and two math packages, you can create a total of
  571.  eight combined libraries. But the more combined libraries you create, the
  572.  more space they'll take on your hard disk and the longer the installation
  573.  process will take.
  574.  
  575.  The first time you install QuickC, create only one or two combined
  576.  libraries. If you find a need for other memory models or math packages, just
  577.  run the SETUP program again.
  578.  
  579.  
  580.  Include Graphics Libraries?
  581.  
  582.  The graphics library GRAPHICS.LIB contains numerous functions for drawing
  583.  lines, rectangles, circles, and other shapes. If you plan to write programs
  584.  that use these functions, press Y to answer the first of these two
  585.  questions:
  586.  
  587.    Include in combined libraries:GRAPHICS.LIB[N]: PGCHART.LIB[N]:
  588.  
  589.  However, if you plan to write programs that use text output only, then you
  590.  probably don't need GRAPHICS.LIB taking up room on your disk. Press N to
  591.  omit the graphics library. (If you very rarely need graphics functions, you
  592.  can omit the graphics library and, whenever you need the functions,
  593.  explicitly link the graphics library GRAPHICS.LIB. See the Microsoft QuickC
  594.  Tool Kit manual for more information about linking with a specific library.)
  595.  
  596.  
  597.  The PGCHART.LIB library contains presentation graphics functions for
  598.  creating high-resolution graphs (line graphs, bar charts, column charts,
  599.  scatter diagrams, and pie charts). Again, if you want to display such
  600.  graphics in your programs, press Y to include this component library. If
  601.  you'll use presentation graphics rarely or not at all, press N to omit this
  602.  library.
  603.  
  604.  
  605.  Second Screen: Extra Files
  606.  
  607.  The next screen asks the following questions about copying additional files
  608.  to your hard disk:
  609.  
  610.    Install Microsoft Mouse [Y]:
  611.    Copy documentation files [Y]:
  612.    Copy the DOS patch files [N]:
  613.    Copy sample C programs [N]:
  614.    Copy the QuickC tutorial files [N]:
  615.  
  616.    Do you want to change any of the above options [Y]:
  617.  
  618.  SETUP will copy these extra files to your hard disk if you want them.
  619.  
  620.  As before, each of these questions is accompanied by an explanation at the
  621.  bottom of your screen to help you decide if these files would be useful.
  622.  
  623.  
  624.  Third Screen: The Directories
  625.  
  626.  The final set of questions asks for the names of directories in which to
  627.  store the various files.
  628.  
  629.    Directory for Executable files [C:\QC25\BIN]:
  630.    Directory for Libraries [C:\QC25\LIB]:
  631.    Directory for Include files [C:\QC25\INCLUDE]:
  632.    Directory for Sample files [C:\QC25\SAMPLES]:
  633.    Directory for Tutorial files [C:\QC25\TUTORIAL]:
  634.  
  635.    Do you want to change any of the above options [Y]:
  636.  
  637.  You don't have to choose any of the default options. You might decide you
  638.  want your executable programs in C:\QC25\BIN and your source files in
  639.  C:\C_CODE, for example. Type in the names of directories you want SETUP to
  640.  use (including the drive name in the path). If the directories don't exist,
  641.  SETUP asks if you want to create them.
  642.  
  643.  QuickC can be used in conjunction with the Microsoft C Professional
  644.  Development System version 6.0. To use QuickC with Microsoft C, choose the
  645.  directories where Microsoft C stores executable files, libraries, and header
  646.  files: their default names are C:\C600\BIN, C:\C600\LIB, and
  647.  C:\C600\INCLUDE; corresponding QuickC directories are C:\QC25\BIN,
  648.  C:\QC25\LIB, and C:\QC25\INCLUDE.
  649.  
  650.  
  651.  Checking the Available Disk Space
  652.  
  653.  Before moving on to stage two, the SETUP program checks your hard disk to
  654.  see how much free space is available. If you don't have enough room to
  655.  install QuickC (the amount needed varies according to the options you've
  656.  chosen), an error message tells you how much space is required for the files
  657.  you've requested. If you attempt to install all possible libraries, you'll
  658.  need approximately 6 megabytes. If you install just one combined library,
  659.  you'll need roughly 2.7 megabytes.
  660.  
  661.  If you don't have enough room on your hard disk, you have two choices.
  662.  First, you can delete files from the hard disk until there's enough room for
  663.  the libraries you want to create. Second, you can reduce the number of
  664.  libraries you request (or you can choose not to copy the samples and
  665.  documentation files) to cut down the amount of space you need. Either way,
  666.  you'll have to run SETUP again.
  667.  
  668.  
  669.  SETUP Stage Two
  670.  
  671.  Now that you've specified your system and programming needs, SETUP goes to
  672.  work. This stage requires you to swap the distribution disks in and out of
  673.  the drive. Insert the disks as SETUP asks for them and press ENTER. If you
  674.  put in the wrong disk, SETUP will ask again for the proper disk.
  675.  
  676.  At this point, all SETUP needs is the go-ahead from you. It starts building
  677.  the combined libraries you requested, placing them in the directories you
  678.  specified.
  679.  
  680.  
  681.  SETUP Stage Three
  682.  
  683.  When SETUP finishes creating the combined libraries, it creates two files:
  684.  NEW-VARS.BAT and NEW-CONF.SYS. To install these files permanently, you must
  685.  now adjust the DOS environment and modify both your AUTOEXEC.BAT and
  686.  CONFIG.SYS files.
  687.  
  688.  ────────────────────────────────────────────────────────────────────────────
  689.  NOTE
  690.  
  691.  If you use other languages that have their own LINK.EXE program, you may not
  692.  want to put the QuickC linker in your path. If this is the case, you can
  693.  modify CONFIG.SYS and run NEW-VARS.BAT each time you use QuickC.
  694.  ────────────────────────────────────────────────────────────────────────────
  695.  
  696.  
  697.  Changing AUTOEXEC.BAT
  698.  
  699.  The file NEW-VARS.BAT created by SETUP might look something like this:
  700.  
  701.    PATH=C:\QC25\BIN;C:\DOS;C:\MYEXE;C:\WIN386;C:\WORD
  702.    set LIB=C:\QC25\LIB
  703.    set INCLUDE=C:\QC25\INCLUDE
  704.  
  705.  PATH is a system variable that tells your computer where to find executable
  706.  programs. The LIB and INCLUDE variables tell QuickC where to find the
  707.  libraries and the include files.
  708.  
  709.  To make the change permanent, load your current AUTOEXEC.BAT file into an
  710.  editor or word processor (you'll find AUTOEXEC.BAT in the root directory),
  711.  add the new path names, and save the modified file.
  712.  
  713.  You can edit the AUTOEXEC.BAT file with the QuickC editor if you wish.
  714.  Change to the directory containing the QC.EXE program (for example, type  CD
  715.  \QC25\BIN ) and type  QC \AUTOEXEC.BAT (the backslash indicates that the
  716.  file is in the root directory). Then use the File menu Merge command to
  717.  merge NEW-VARS.BAT into AUTOEXEC.BAT.
  718.  
  719.  In most cases, it is best to change the AUTOEXEC.BAT file and reboot.
  720.  How-ever, if you use other languages and other compilers, you may wish to
  721.  leave the AUTOEXEC.BAT file alone and run the NEW-VARS.BAT file before each
  722.  QuickC session.
  723.  
  724.  If you want to use the 8087 math library instead of the emulator library,
  725.  use the /FPi87 option as a custom flag within the QuickC Linker Flags dialog
  726.  box or at the command line using QCL. If you compile and link from the
  727.  QuickC environment, either add the line below to your AUTOEXEC.BAT file or
  728.  type it at the command line:
  729.  
  730.    SET CL=/FPi87
  731.  
  732.  To maintain compatibility between the QuickC and Microsoft C compilers, the
  733.  CL environment variable is used. If you include options that the Microsoft C
  734.  compiler recognizes but QuickC doesn't, QuickC issues an error message.
  735.  
  736.  
  737.  Modifying CONFIG.SYS
  738.  
  739.  The NEW-CONF.SYS file might look like this:
  740.  
  741.    files=20
  742.    buffers=10
  743.  
  744.  You need to be sure that the  files  and  buffer  values are large enough to
  745.  contain QuickC. Load your CONFIG.SYS file into an editor or word processor
  746.  (again, it should be in the root directory), change the two lines that refer
  747.  to files and buffers, and save the modified file. If your current CONFIG.SYS
  748.  file has higher numbers ( files = 30, for example), you can leave the higher
  749.  value in effect. The numbers in NEW-CONF.SYS are minimums; you may safely
  750.  use higher values.
  751.  
  752.  ────────────────────────────────────────────────────────────────────────────
  753.  NOTE
  754.  
  755.  Merely changing the AUTOEXEC.BAT and CONFIG.SYS files does not affect the
  756.  current DOS environment. To put the changes into effect, you must reboot
  757.  your machine by powering off and then on or by pressing CTRL+ALT+DEL.
  758.  ────────────────────────────────────────────────────────────────────────────
  759.  
  760.  After installing QuickC, changing the files, and rebooting, you can proceed
  761.  to Chapter 3, "Using QuickC."
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  Chapter 3  Using QuickC
  769.  ────────────────────────────────────────────────────────────────────────────
  770.  
  771.  If you followed the instructions in Chapter 2, "Installing QuickC," you now
  772.  have a working version of the QuickC Compiler and are ready to write your
  773.  first program. This chapter introduces the QuickC environment─a powerful
  774.  tool to help you write and test programs.
  775.  
  776.  In this chapter you'll work through a sample compiling and linking session.
  777.  When you finish, you will have written, saved, built, and tested a working
  778.  program.
  779.  
  780.  If you'd prefer to experiment on your own or if you've previously used an
  781.  older version of QuickC, you can skip this chapter (or skim through it). We
  782.  strongly suggest, however, that if you do nothing else, review the next
  783.  chapter, "Getting Help." In addition, we recommend that all QuickC users run
  784.  the LEARN program, which teaches how to use the QuickC environment.
  785.  
  786.  
  787.  The QuickC Environment
  788.  
  789.  QuickC is a window-based programming environment that integrates a text
  790.  editor, a compiler, a linker, a debugger utility, a make utility, and an
  791.  on-line help database. This chapter introduces and describes the following
  792.  aspects of QuickC:
  793.  
  794.  Windows and Menus - The menu system allows you to quickly find the command
  795.  or action you need. The first part of this chapter explains how to open and
  796.  close windows and how to navigate the menus. It also defines certain terms
  797.  used throughout the chapter.
  798.  
  799.  Editor - When you're writing source code, you'll spend a lot of time using
  800.  the QuickC editor. If you know WordStar(R) commands, you'll know how to use
  801.  the QuickC editor. If you'd prefer to customize the editor, you can use the
  802.  MKKEY utility, which is explained in the "Customizing the Editor" section.
  803.  
  804.  Compiler/Linker - You can compile, link, and test a program without ever
  805.  leaving the editor. QuickC's integrated environment saves you hours of
  806.  development time. This part of the chapter defines and illustrates the
  807.  various compiling and linking options.
  808.  
  809.  Debugger - The debugger allows you to set breakpoints, to monitor the status
  810.  of key variables, and to trace program execution line by line. This section
  811.  of the chapter provides a brief overview of the debugger utility. The LEARN
  812.  program includes a lesson that provides more details about the new, advanced
  813.  debugging enhancements.
  814.  
  815.  
  816.  Using Windows and Menus
  817.  
  818.  Even if you've never used windows and menus before, you'll find the QuickC
  819.  programming environment easy to learn.
  820.  
  821.  This section introduces the QuickC environment. You'll learn how to control
  822.  windows and to choose commands from the menus.
  823.  
  824.  
  825.  Getting Started
  826.  
  827.  To run QuickC, type
  828.  
  829.    QC
  830.  
  831.  at the DOS prompt. You'll immediately enter the QuickC editor.
  832.  
  833.  If you enter a file name after the  QC  command, for example,
  834.  
  835.    QC MYFILE
  836.  
  837.  QuickC automatically adds the extension .C that marks a C source file.
  838.  Typing the line above causes QuickC to load MYFILE.C.
  839.  
  840.  If QuickC can't find the file you specified in the current directory, it
  841.  asks if you want to create a new file.
  842.  
  843.  If you do not enter a file name after the  QC  command, QuickC opens an
  844.  empty file named UNTITLED.C, which you can rename later or save with another
  845.  name.
  846.  
  847.  
  848.  Command-Line Options
  849.  
  850.  Depending on your particular hardware, you may be required to include one of
  851.  the following options on the command line after the  QC  command but before
  852.  the file name, for example,  QC /b MYPROG.
  853.  
  854.  Option                            Hardware
  855.  ────────────────────────────────────────────────────────────────────────────
  856.  /b                                For black-and-white systems, including
  857.                                    Hercules(R) monochrome monitors, LCD
  858.                                    screens, and black-and- white monitors.
  859.  
  860.  /g                                For AT-compatible systems that refresh
  861.                                    the screen at a slower rate than the
  862.                                    standard AT (including some COMPAQ(R)
  863.                                    systems).
  864.  
  865.  /h                                For systems equipped with EGA-, VGA-, or
  866.                                    MCGA-compatible graphics cards capable
  867.                                    of displaying more than 25 lines of text.
  868.                                    EGA cards can display 43 lines of text,
  869.                                    VGA cards can display 50. You can use a
  870.                                    Microsoft (or fully compatible) mouse
  871.                                    with this option. If you encounter
  872.                                    problems, contact the manufacturer of
  873.                                    the mouse.
  874.  
  875.  /k                                Loads a key file with customized QuickC
  876.                                    editor
  877.                                    commands.
  878.  
  879.  /nohi                             For systems that don't support
  880.                                    high-intensity colors (including LCD
  881.                                    monochrome monitors and some Amdek(R)
  882.                                    color monitors).
  883.  
  884.  
  885.  Using the Mouse and Keyboard
  886.  
  887.  You can enter all commands from the keyboard. If you own a Microsoft (or
  888.  fully compatible) Mouse, you can choose to use either the keyboard or the
  889.  mouse to enter commands. When this book explains a command, the two options
  890.  are marked with icons of a key or a mouse as follows:
  891.  
  892.  Press the ALT key.
  893.  
  894.  Click the File menu, then click Save.
  895.  
  896.  Unless the right button is specifically mentioned, "clicking" means that you
  897.  click the mouse's left button once.
  898.  
  899.  
  900.  Windows
  901.  
  902.  The system of windows and menus is simple to use and intuitive. Many
  903.  programmers can learn how to use the QuickC environment without learning the
  904.  terms that describe the various menus and buttons. In addition, if you're
  905.  confused about windows or menus, you can almost always call up a help window
  906.  that explains how a menu works (see Chapter 4, "Getting Help"). However, if
  907.  you want to read further in this chapter, you'll have to understand the
  908.  terms that are used.
  909.  
  910.  Figure 3.1 shows a typical QuickC screen, with labels that describe its
  911.  parts. Some of the parts provide information only. For example, if the CAPS
  912.  LOCK key is on, a letter  C  appears in the bottom right corner. The letter
  913.  C  is informational (it tells you the CAPS LOCK key is on). Other parts of a
  914.  window perform actions triggered by a specific key or mouse action. For
  915.  example, if you click the little box in the upper-left corner of a window,
  916.  the window closes. The box is not informational; it's active.
  917.  
  918.  (This figure may be found in the printed book.)
  919.  
  920.  The parts of a window, their status, and their use are listed in Table 3.1.
  921.  
  922.  
  923.  Table 3.1  Parts of a Window
  924.  
  925. ╓┌────────────────┌─────────────────────┌────────────────────────────────────╖
  926.  Name             Status                Use
  927.  ────────────────────────────────────────────────────────────────────────────
  928.  Close button     Active                Closes the current window (the
  929.                                         source window cannot be closed).
  930.                                         Appears in upper-left corner.
  931.  
  932.  Menu bar         Active                Lists names of the available menus.
  933.  
  934.  Title bar        Informational         Shows name of the window (the
  935.                                         source window title bar lists the
  936.                                         file currently being edited).
  937.  
  938.  Source window    Active                Contains source code for the
  939.                                         program you're writing. Seven other
  940.                                         windows are supported: Debug, Help,
  941.                                         Locals, Registers, Notepad, Output,
  942.                                         and Errors.
  943.  
  944.  Maximize button  Active                Shrinks or enlarges the current
  945.                                         window.
  946.  
  947.  Name             Status                Use
  948.  ────────────────────────────────────────────────────────────────────────────
  949. 
  950.  Reference bar    Informational/        Lists shortcut keystrokes (keyboard
  951.                   Active                users) and direct commands to
  952.                                         QuickC (mouse users).
  953.  
  954.  
  955.  
  956.  Table   3.1 (continued)
  957.  
  958. ╓┌───────────────────────┌──────────────┌────────────────────────────────────╖
  959.  Name                    Status         Use
  960.  ────────────────────────────────────────────────────────────────────────────
  961.  Scroll bars             Active         Indicate your position in the
  962.                                         current file. If you click in the
  963.                                         gray area on either side of the
  964.                                         position marker, you move in that
  965.                                         direction. If you click the arrows,
  966.                                         you move one line (or one character)
  967.                                         in that direction. If you click and
  968.  Name                    Status         Use
  969.  ────────────────────────────────────────────────────────────────────────────
  970.                                        in that direction. If you click and
  971.                                         drag the position indicator, you
  972.                                         can move anywhere within the file.
  973.  
  974.  Line/Column             Informational  Show the current line and column of
  975.  indicators                             the text cursor.
  976.                                         C means CAPS LOCK is on.
  977.                                         N means NUM LOCK is on.
  978.  
  979.  File status indicators  Informational  R means the file is set to Read
  980.                                         Only status.
  981.                                         D means Debugging History is on.
  982.                                         I means the debugging history
  983.                                         includes user input.
  984.  
  985.  ────────────────────────────────────────────────────────────────────────────
  986.  
  987.  
  988.  
  989.  
  990.  Using the Menu Bar
  991.  
  992.  To choose a command from a menu, you "pull down" or "open" the menu and
  993.  choose the command you want:
  994.  
  995.  
  996.    1.  Press the ALT key to activate the menu bar.
  997.  
  998.    2.  Press the highlighted character in the menu name (F = File, for
  999.        example).
  1000.  
  1001.    3.  Press the highlighted character in the item name (in the File menu, S
  1002.        = Save, for example).
  1003.  
  1004.  
  1005.  Or follow these steps:
  1006.  
  1007.  
  1008.    1.  Press the ALT key.
  1009.  
  1010.    2.  Use the RIGHT and LEFT arrow keys to move to the menu you want.
  1011.  
  1012.    3.  Use the UP and DOWN arrow keys to highlight the command.
  1013.  
  1014.    4.  Press ENTER.
  1015.  
  1016.  
  1017.  Or:
  1018.  
  1019.  
  1020.    1.  Open the menu by clicking the menu name.
  1021.  
  1022.    2.  Click the command.
  1023.  
  1024.  
  1025.  
  1026.  Making the Menu Disappear
  1027.  
  1028.  If at any point you decide that you don't want to choose a command from a
  1029.  menu, you can make the menu disappear:
  1030.  
  1031.  Press the ESC key.
  1032.  
  1033.  Click somewhere on the screen outside of the menu.
  1034.  
  1035.  
  1036.  Shortcut Keys
  1037.  
  1038.  In the menus below, you'll notice that certain menu items are followed by
  1039.  names of keys. These are the "shortcut keys" for heavily used commands. For
  1040.  example, the Run menu Restart command is followed by SHIFT+F5, which means
  1041.  that instead of opening the Run menu and choosing the Restart command, you
  1042.  can instead hold down the SHIFT key and press F5.
  1043.  
  1044.  ────────────────────────────────────────────────────────────────────────────
  1045.  NOTE
  1046.  
  1047.  The reference bar displays commonly used shortcut keys. In addition, the
  1048.  inside front cover of this book lists the important shortcut keys for easy
  1049.  reference.
  1050.  ────────────────────────────────────────────────────────────────────────────
  1051.  
  1052.  
  1053.  Menus
  1054.  
  1055.  The menu bar contains ten menus, which you can pull down at any time. If you
  1056.  don't know what a menu does, invoke the online help system by highlighting
  1057.  the menu title (or highlighting a command within a menu) and pressing F1 or
  1058.  clicking the right mouse button. QuickC uses the following menus:
  1059.  
  1060. ╓┌────────────────────────────────────┌──────────────────────────────────────╖
  1061.  ────────────────────────────────────────────────────────────────────────────
  1062.  (Please refer to the printed book.)  The File menu controls files,
  1063.                                       allowing you to clear the source
  1064.                                       window (New), load an existing source
  1065.                                       file (Open), append a file to the
  1066.                                       source code in memory (Merge), save
  1067.                                       the current file (Save), rename the
  1068.                                       current file (Save As), print the
  1069.                                       source code (Print), temporarily quit
  1070.                                       to DOS (DOS Shell) and return to
  1071.                                       QuickC by typing EXIT at the command
  1072.                                       line, or permanently exit QuickC
  1073.  ────────────────────────────────────────────────────────────────────────────
  1074.                                      line, or permanently exit QuickC
  1075.                                       (Exit).
  1076.  
  1077.  (Please refer to the printed book.)  From the Edit menu you manipulate
  1078.                                       text by deleting, cutting, copying,
  1079.                                       and pasting lines of code. You can
  1080.                                       also set Read Only status to protect
  1081.                                       source files.
  1082.  
  1083.  (Please refer to the printed book.)  The View menu controls the visible
  1084.                                       screen. You can rapidly switch
  1085.                                       between multiple modules (Source),
  1086.                                       read through include files (Include)
  1087.                                       make visible the output screen
  1088.                                       (Output Screen), expand the source
  1089.                                       window (Maximize), or open and close
  1090.                                       the various windows (Windows).
  1091.  
  1092.  (Please refer to the printed book.)  The Search menu invokes the commands
  1093.                                       that find or replace text or
  1094.  ────────────────────────────────────────────────────────────────────────────
  1095.                                      that find or replace text or
  1096.                                       functions in source files. It also
  1097.                                       moves to a specified line and
  1098.                                       searches for the next source line
  1099.                                       that caused a compiler error.
  1100.  
  1101.  (Please refer to the printed book.)  The Make menu allows you to compile
  1102.                                       (Compile) or to compile and link
  1103.                                       (Build) programs. From this menu, you
  1104.                                       also create or edit program lists
  1105.                                       that name the components of a
  1106.                                       multimodule program.
  1107.  
  1108.  (Please refer to the printed book.)  Once a program is compiled and
  1109.                                       residing in memory, use the Run menu
  1110.                                       to run it. You can run it from
  1111.                                       beginning to end, selectively run
  1112.                                       individual sections, or trace through
  1113.                                       the program line by line.
  1114.  
  1115.  ────────────────────────────────────────────────────────────────────────────
  1116. 
  1117.  (Please refer to the printed book.)  If your program contains logic errors,
  1118.                                       the Debug menu allows you to set
  1119.                                       breakpoints, watchpoints, and watch
  1120.                                       values. In addition, you can keep
  1121.                                       track of variables and their changing
  1122.                                       values. (This feature means there's
  1123.                                       no need to sprinkle printf functions
  1124.                                       throughout your program just to watch
  1125.                                       variables as they change values.)
  1126.  
  1127.  (Please refer to the printed book.)  The Utility menu allows you to run
  1128.                                       DOS commands and programs from within
  1129.                                       the QuickC environment. You can run
  1130.                                       the online QuickC tutorial ("Learn
  1131.                                       QuickC"), or if you find that you use
  1132.                                       certain programs often, you may want
  1133.                                       to add them to the Utility menu
  1134.                                       (Customize Menu). For example, you
  1135.                                       can add your favorite program editor
  1136.  ────────────────────────────────────────────────────────────────────────────
  1137.                                      can add your favorite program editor
  1138.                                       to this menu if you wish.
  1139.  
  1140.  (Please refer to the printed book.)  The items on the Options menu control
  1141.                                       the integrated environment. For
  1142.                                       example, the Options menu Color
  1143.                                       command allows you to change the
  1144.                                       colors used on the screen. The
  1145.                                       Options menu Make command controls
  1146.                                       flags that affect the actions of the
  1147.                                       compiler and linker.
  1148.  
  1149.  (Please refer to the printed book.)  The Help menu is one route to the
  1150.                                       online help system. For more about
  1151.                                       this topic, see Chapter 4, "Getting
  1152.                                       Help."
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  Short Menus and Full Menus
  1158.  
  1159.  If you open the Options menu, you'll see one of the two menus below:
  1160.  
  1161. ╓┌────────────────────────────────────┌──────────────────────────────────────╖
  1162.  ────────────────────────────────────────────────────────────────────────────
  1163.  (Please refer to the printed book.)  (Please refer to the printed book.)
  1164.  
  1165.  
  1166.  When six commands are listed under Options and a dot appears beside Full
  1167.  Menus, it means full menus are turned on. When the Options menu holds only
  1168.  two commands and Full Menus has no dot, short menus are in effect.
  1169.  
  1170.  To change from full menus to short menus or vice versa, choose the Full
  1171.  Menus command. The command is a toggle button; that is, it changes from on
  1172.  to off, or off to on, when pressed.
  1173.  
  1174.  The short menus contain all the commands you need to write, compile, and run
  1175.  a C program. The short menus may seem easier to use, especially for
  1176.  beginners. If you prefer to see every possible option, you should enable
  1177.  Full Menus. The choice is yours.
  1178.  
  1179.  ────────────────────────────────────────────────────────────────────────────
  1180.  NOTE
  1181.  
  1182.  When you set preferences from the Options menu─full menus, memory models,
  1183.  compile options, and so on─your choices are saved in the current directory
  1184.  in a file called QC.INI. If you set an option, it stays set from one QuickC
  1185.  session to the next, or until you change it.
  1186.  ────────────────────────────────────────────────────────────────────────────
  1187.  
  1188.  
  1189.  Shaded Commands
  1190.  
  1191.  When a command within a menu is shaded, it is unavailable. You can't use it.
  1192.  
  1193.  
  1194.  For example, when you first run QuickC and haven't yet compiled or linked a
  1195.  program, you can open the Search menu and see that both Next Error and
  1196.  Previous Error are shaded. You haven't done anything to generate errors, so
  1197.  there are no errors to view.
  1198.  
  1199.  
  1200.  Ellipses
  1201.  
  1202.  When a command is followed by three periods (an ellipsis), it means QuickC
  1203.  needs more information before it executes the command. If a command is not
  1204.  followed by an ellipsis, choosing the command causes it to execute
  1205.  immediately.
  1206.  
  1207.  For example, the File menu contains both the Save and Save As... commands.
  1208.  Choosing Save causes QuickC to save the current file with the current name
  1209.  (the file name appearing at the top of the source window). Choosing Save
  1210.  As... causes a dialog box to appear (see the following section). Within that
  1211.  dialog box, you type the new name for your file.
  1212.  
  1213.  
  1214.  Dialog Boxes
  1215.  
  1216.  Very often, invoking a menu command causes a dialog box to appear. For
  1217.  example, Figure 3.2 shows the dialog box opened by the Options menu Display
  1218.  command.
  1219.  
  1220.  (This figure may be found in the printed book.)
  1221.  
  1222.  ────────────────────────────────────────────────────────────────────────────
  1223.  NOTE
  1224.  
  1225.  Dialog boxes usually offer a set of shortcut keys. Press ALT to see which
  1226.  keys are active within a dialog box.
  1227.  ────────────────────────────────────────────────────────────────────────────
  1228.  
  1229.  Dialog boxes can contain one or more of the items on the following list. Use
  1230.  the TAB key to move between the various items in a dialog box.
  1231.  
  1232.  Option Buttons ()                 Option buttons offer a list of choices,
  1233.                                    of which you choose only one. Use the
  1234.                                    arrow keys to move between the choices.
  1235.                                    In Figure 3.2, four option buttons allow
  1236.                                    you to pick the screen color you prefer.
  1237.                                    These are sometimes called "radio
  1238.                                    buttons" because they're similar to the
  1239.                                    buttons on a car radio: pushing in one
  1240.                                    button causes the others to pop out.
  1241.  
  1242.  Check Box [X]                     A check box is a yes/no switch. If the
  1243.                                    box is empty, the feature is turned off.
  1244.                                    If it contains a letter X, the feature
  1245.                                    is on. Press the SPACEBAR to turn a
  1246.                                    check box on or off. Use the TAB key to
  1247.                                    move between check boxes.
  1248.  
  1249.  Text Box [          ]             A text box contains text that you enter.
  1250.                                    In Figure 3.2, the setting for Tab Stops
  1251.                                    requires you to type in the number of
  1252.                                    spaces to be inserted when you press the
  1253.                                    TAB key.
  1254.  
  1255.  Command Buttons                   Command buttons enclosed in angle
  1256.  < OK >                            brackets pass commands to the dialog box.
  1257.                                    The OK button means you're satisfied
  1258.                                    with the choices you've made. The Cancel
  1259.                                    button allows you to exit the dialog box
  1260.                                    with no changes. If one of the command
  1261.                                    buttons is highlighted, pressing ENTER
  1262.                                    invokes that command.
  1263.  
  1264.  List Boxes                        Certain dialog boxes display the current
  1265.                                    disk directory inside a list box. If the
  1266.                                    number of files is too large for the
  1267.                                    list box, you may use the arrow keys and
  1268.                                    PGUP/PGDN (keyboard) or click the scroll
  1269.                                    bar to move around the list (mouse).
  1270.  
  1271.  
  1272.  Using the Editor
  1273.  
  1274.  QuickC's program editor is an important part of the QuickC environment. This
  1275.  part of the chapter provides a brief overview of its many functions.
  1276.  
  1277.  
  1278.  Moving Around in a Source File
  1279.  
  1280.  Many of the keys within the editor act as you would expect. The PGDN and
  1281.  PGUP keys advance you forward or back within the source code. The HOME key
  1282.  moves the cursor to the beginning of the current line. The END key moves the
  1283.  cursor to the end of the current line. The arrow keys move the cursor one
  1284.  character at a time. QuickC also has a command for moving around in a source
  1285.  file: The Go to command in the Search menu moves the cursor to a specified
  1286.  line number.
  1287.  
  1288.  ────────────────────────────────────────────────────────────────────────────
  1289.  NOTE
  1290.  
  1291.  For a complete list of editor commands, use online help. Open the Help menu,
  1292.  choose the Contents command, then get help about the Keyboard under the
  1293.  Orientation heading.
  1294.  ────────────────────────────────────────────────────────────────────────────
  1295.  
  1296.  You can invoke many of the editor commands in two different ways. For
  1297.  example, to move one word to the right, you can press either CTRL+RIGHT or
  1298.  CTRL+F. The second choice is part of the WordStar-compatible command set. If
  1299.  you're familiar with WordStar commands, you already know how to use the
  1300.  QuickC editor. There is one difference you should know: you don't use
  1301.  separate commands to mark the beginning and end of a block of text.
  1302.  
  1303.  
  1304.  Defining a Block
  1305.  
  1306.  While you're working on a C program, you may want to delete a large block of
  1307.  text or copy it to another place in the program. To do this, you must define
  1308.  the block:
  1309.  
  1310.  Move the cursor to the beginning of the block. Hold down the SHIFT key and
  1311.  move to the end of the block. Use the other editing keys (HOME, END,
  1312.  CTRL+RIGHT, and so on) while you're holding down SHIFT to extend the block.
  1313.  
  1314.  
  1315.  Move the mouse cursor to the beginning of the block. While holding down the
  1316.  left button, move to the end of the block.
  1317.  
  1318.  After defining a block, you can do several things: use the DELETE key to
  1319.  erase it or use SHIFT+DEL to copy it into the Paste buffer (then use
  1320.  SHIFT+INS to insert the buffer into the source file at the current cursor
  1321.  location).
  1322.  
  1323.  While a block is defined, anything you type will replace the defined text.
  1324.  
  1325.  You can also press the TAB key to indent the entire block an additional tab
  1326.  setting or SHIFT+TAB to remove all tab settings.
  1327.  
  1328.  
  1329.  Customizing the Editor
  1330.  
  1331.  If you'd prefer to use another set of editing commands, QuickC comes with
  1332.  four "key" files, which are files that define the keystrokes for editor
  1333.  commands, along with a utility for making your own key file. The four key
  1334.  files are QC.KEY, ME.KEY, BRIEF.KEY, and EPSILON.KEY. Refer to Appendix A
  1335.  for a complete list of the commands they control (for example, the QuickC
  1336.  and Microsoft editors use CTRL+E to move the cursor up, while Epsilon(tm)
  1337.  uses CTRL+P).
  1338.  
  1339.  To change to a new key file, use the /k: option when you run QuickC. For
  1340.  example, to load the BRIEF.KEY file, enter this line, using just the file
  1341.  name and not the fully qualified path:
  1342.  
  1343.    QC /k:BRIEF.KEY
  1344.  
  1345.  Your preference is automatically saved in the QC.INI file. In future editing
  1346.  sessions, you won't need to specify the key file.
  1347.  
  1348.  
  1349.  Creating Your Own Key File
  1350.  
  1351.  The MKKEY program allows you to make your own key file. You must use three
  1352.  options: -c, -i, and -o. The first (-c) specifies the type of conversion:
  1353.  ASCII to binary (ab) or binary to ASCII (ba). The two others specify the
  1354.  input file (-i) and the output file (-o).
  1355.  
  1356.  To modify the default QC.KEY file, you first convert it to an editable ASCII
  1357.  file:
  1358.  
  1359.    MKKEY -c ba -i QC.KEY -o MYEDITOR.TXT
  1360.  
  1361.  You can use any text editor (including QuickC's) to edit the file named
  1362.  MYEDITOR.TXT, which lists the keystrokes that perform certain actions. For
  1363.  example, you press CTRL+G to delete a character. The line in MYEDITOR.TXT
  1364.  looks like this:
  1365.  
  1366.    Del : CTRL+G
  1367.  
  1368.  You could change that command to any other keystroke (CTRL+D, for example),
  1369.  as long as the key isn't already assigned to another function. Elsewhere in
  1370.  the file, CTRL+D is assigned to CharRight, so you'd have to delete or change
  1371.  that line if you wanted to use CTRL+D for the Del function.
  1372.  
  1373.  When you're satisfied with the new functions, you must convert the ASCII
  1374.  file to binary, so that it can be loaded into the QuickC editor:
  1375.  
  1376.    MKKEY -c ab -i MYEDITOR.TXT -o MYEDITOR.KEY
  1377.  
  1378.  Finally, to load the new key file, use the /k: option described above.
  1379.  
  1380.  ────────────────────────────────────────────────────────────────────────────
  1381.  NOTE
  1382.  
  1383.  If you customize the QuickC editor by creating a key file, you are not
  1384.  allowed to assign functions to CTRL+@.
  1385.  ────────────────────────────────────────────────────────────────────────────
  1386.  
  1387.  
  1388.  Using Another Editor
  1389.  
  1390.  If you'd prefer to use your favorite word processor or text editor for
  1391.  writing programs, use the Customize Menu command in the Utility menu. This
  1392.  allows you to run any other program (including word processors) from within
  1393.  the QuickC environment. When you exit the program, you'll return to QuickC.
  1394.  
  1395.  
  1396.  To use another editor, choose the Customize Menu command in the Utility
  1397.  menu. Highlight the Custom &Editor item and select the Edit button. List the
  1398.  path and the name of the editor in the Path Name text box. (It isn't
  1399.  necessary to include the .EXE extension.) For example, you could list
  1400.  \BIN\B,\EDITORS\EPS or MYDIR\M. If you're using Brief, Epsilon, or the
  1401.  Microsoft Editor, read the appropriate section below.
  1402.  
  1403.  
  1404.  Brief
  1405.  
  1406.  Type the following in the Arguments text box:
  1407.  
  1408.    -m"editat $LINE $COL" $FILE
  1409.  
  1410.  Add the following macro to your Brief macro file:
  1411.  
  1412.    ;*** editat ─ interface to QC Utility.Edit menu
  1413.    ; SYNOPSIS
  1414.    ; b -m"editat $LINE $COL" $FILE
  1415.    ; DESCRIPTION
  1416.    ; editat positions Brief at the specified line and column in the
  1417.    ; current file.  It is invoked from the command line (i.e -m).
  1418.    ;*
  1419.  
  1420.    (macro editat
  1421.       (
  1422.          (int line col)
  1423.  
  1424.          (get_parm 0 line)
  1425.          (get_parm 1 col)
  1426.          (move_abs line col)
  1427.       )
  1428.    )
  1429.  
  1430.  
  1431.  Epsilon
  1432.  
  1433.  Type the following in the Arguments text box:
  1434.  
  1435.    $FILE +$LINE
  1436.  
  1437.  
  1438.  M Editor
  1439.  
  1440.  Type the following in the Arguments text box:
  1441.  
  1442.    /e "Arg \"$LINE\" Mark" $FILE
  1443.  
  1444.  
  1445.  Compiling and Linking
  1446.  
  1447.  Your ultimate goal in writing C programs is to create an executable program.
  1448.  To convert a C source file to a runnable program, you must compile and link
  1449.  it. This section introduces the commands that compile and link programs, a
  1450.  process called "building."
  1451.  
  1452.  When QuickC builds a program, it performs two steps:
  1453.  
  1454.  
  1455.    1.  It compiles the .C source file into an object (.OBJ) file.
  1456.  
  1457.    2.  It links the object file with other object files or libraries to
  1458.        create an executable (.EXE) file.
  1459.  
  1460.  
  1461.  Although you have the option of going through these two steps, it's
  1462.  generally easier and more convenient to build a program with a single
  1463.  command.
  1464.  
  1465.  
  1466.  Building within the QuickC Environment
  1467.  
  1468.  This section illustrates how to compile and link a C program. First, type in
  1469.  this program and use the Save As command in the File menu to save the file
  1470.  as HI.C:
  1471.  
  1472.    /* HI.C: Prints hello and a name */
  1473.  
  1474.    #include <stdio.h>
  1475.  
  1476.    main()
  1477.    {
  1478.       char name[80];
  1479.  
  1480.       printf( "Type your name, please.\n" );
  1481.       gets( name );
  1482.       printf( "Hello, %s\n", name );
  1483.    }
  1484.  
  1485.  The output of this simple program tells you to type your name. You enter any
  1486.  string of characters, and it says hello to you.
  1487.  
  1488.  The program calls two library functions: printf and gets. For more
  1489.  information about what these functions do, use the online help system.
  1490.  Position the cursor on the function name and press F1. To close the Help
  1491.  window, press ESC. Online help is explained in greater detail in the next
  1492.  chapter.
  1493.  
  1494.  ────────────────────────────────────────────────────────────────────────────
  1495.  NOTE
  1496.  
  1497.  By default, QuickC names a new file UNTITLED.C. You should always explicitly
  1498.  name your file before you compile.
  1499.  ────────────────────────────────────────────────────────────────────────────
  1500.  
  1501.  
  1502.  Compiling and Linking
  1503.  
  1504.  To build a program, open the Make menu and choose Build Program. Or use one
  1505.  of these shortcuts:
  1506.  
  1507.  Press SHIFT+F5 to build the program.
  1508.  
  1509.  Click the <Shift+F5=Restart> button on the reference bar at the bottom of
  1510.  the screen.
  1511.  
  1512.  A dialog box appears on the screen to show you how far the compiler and
  1513.  linker have progressed. The compiler or linker may halt if anything goes
  1514.  wrong. When the source file contains errors, the Errors window appears and
  1515.  the offending line is highlighted in the source window.
  1516.  
  1517.  Note that incremental linking uses expanded memory, as defined by the
  1518.  Lotus-Intel-Microsoft (LIM) specification versions 3.2 and higher, if it is
  1519.  available. If you have installed additional memory on an 80286 or 80386
  1520.  system, you may encounter problems when linking incrementally, especially if
  1521.  you have configured the board to use both extended and expanded memory. In
  1522.  particular, your computer may lock up if you use incremental linking in
  1523.  conjunction with a Talltrees AT3 expanded memory board. (Other boards may or
  1524.  may not be subject to this problem.) If this happens, you have several
  1525.  choices:
  1526.  
  1527.  
  1528.    ■   Contact the manufacturer of the memory board for information on
  1529.        solving this problem.
  1530.  
  1531.    ■   Remove the Expanded Memory Manager (EMM) device driver and continue to
  1532.        link incrementally.
  1533.  
  1534.    ■   Disable extended memory (used by VDISK) and continue to link
  1535.        incrementally.
  1536.  
  1537.    ■   Leave the memory device driver in place, but turn off incremental
  1538.        linking. From the QuickC environment, choose the Make command in the
  1539.        Options menu and select the Linker Flags button. From the command
  1540.        line, avoid the /Li option.
  1541.  
  1542.    ■   Contact Microsoft Product Support for additional suggestions.
  1543.  
  1544.  
  1545.  
  1546.  Running the Program
  1547.  
  1548.  When the program has been built, the reference bar displays several new
  1549.  items, including  <F5=Run>. To run the program, open the Run menu and choose
  1550.  Go. Or use the shortcuts:
  1551.  
  1552.  Press F5.
  1553.  
  1554.  Click  <F5=Run>  on the reference bar.
  1555.  
  1556.  
  1557.  Compiling, Linking, and Running
  1558.  
  1559.  It's not necessary to press SHIFT+F5 (to build the program) before you press
  1560.  F5 (to run it). If you simply press F5, the QuickC editor knows if the
  1561.  source code in memory has changed. If it has changed, you'll be asked if you
  1562.  want to rebuild the program.
  1563.  
  1564.  
  1565.  Viewing the Output Window
  1566.  
  1567.  When you choose Go from the Run menu (or press F5), the output is
  1568.  automatically directed to the output screen. To see this output:
  1569.  
  1570.  Press F4 to toggle between the two screens.
  1571.  
  1572.  Open the View window and choose Output Screen. Click once to return to the
  1573.  source window.
  1574.  
  1575.  If you'd prefer to have both the Output and source windows visible at the
  1576.  same time, choose the Windows command from the View menu and then choose
  1577.  Output.
  1578.  
  1579.  
  1580.  Saving the Program
  1581.  
  1582.  To save the source file using the current name, go to the File menu and
  1583.  choose either Save or Save As. If you use Save, QuickC automatically saves
  1584.  the file under the name listed on the top line of the source window. If you
  1585.  prefer to use another name, choose Save As. The following dialog box
  1586.  appears:
  1587.  
  1588.  (This figure may be found in the printed book.)
  1589.  
  1590.  Type in the new name of the source file. If you don't add an extension,
  1591.  QuickC automatically adds .C (HI becomes HI.C, for example).
  1592.  
  1593.  
  1594.  Building from Multiple Source Files
  1595.  
  1596.  Now we'll make things a little more complicated by writing a multiple-module
  1597.  program.
  1598.  
  1599.  First, edit the HI.C program, adding a few lines:
  1600.  
  1601.    /* HIA.C: Illustrates external functions */
  1602.  
  1603.    #include <stdio.h>
  1604.  
  1605.    main()
  1606.    {
  1607.       char name[80];
  1608.  
  1609.       welcome();
  1610.       outsider();
  1611.       printf( "Type your name, please.\n" );
  1612.       gets( name );
  1613.       printf( "Hello, %s\n", name );
  1614.    }
  1615.    welcome()
  1616.    {
  1617.       printf( "Welcome to the program.\n" );
  1618.    }
  1619.  
  1620.  The  main  function calls two new functions:  welcome  and  outsider. Unlike
  1621.   printf  and  gets, which are library functions,  welcome  and outsider are
  1622.  functions defined within the program. Note the definition of  welcome  below
  1623.  the  main  function.
  1624.  
  1625.  Don't compile the program yet. Save it as HIA.C and then choose New from the
  1626.  File menu. Type in this second program:
  1627.  
  1628.    /* HIB.C: Second program for HIA.C */
  1629.  
  1630.    outsider()
  1631.    {
  1632.       printf( "This line is from the HIB.C file.\n" );
  1633.    }
  1634.  
  1635.  Save it as HIB.C. Now there are two source files on your disk: HIA.C and
  1636.  HIB.C.
  1637.  
  1638.  There are several reasons to split a file into multiple modules. If you
  1639.  write a function that's used in several programs, you can give it its own
  1640.  source file. If you write long programs, splitting the file up makes editing
  1641.  easier. In addition, the Build Program command takes less time because it
  1642.  recompiles only the source files you've changed, instead of the entire
  1643.  program.
  1644.  
  1645.  
  1646.  Creating a Program List
  1647.  
  1648.  Since the example program now uses two source files, we must create a
  1649.  program list (also called a "make file") that tells QuickC which source
  1650.  files should be compiled.
  1651.  
  1652.  Open the Make menu and choose Set Program List (you must have Full Menus
  1653.  enabled). Type the name HIA.MAK as the name of the file containing the
  1654.  program list (the MAK extension is used for make files), and when QuickC
  1655.  asks if it should create the file, press ENTER.
  1656.  
  1657.  The following dialog box appears:
  1658.  
  1659.  (This figure may be found in the printed book.)
  1660.  
  1661.  Now you must add both HIA.C and HIB.C to the list of programs.
  1662.  
  1663.  Press TAB until the cursor is within the list box containing the directory
  1664.  of C source files (another list box lists the directory names). Use the
  1665.  arrow keys to move to the HIA.C file. Press ENTER and the file name will
  1666.  appear in the program list below. Repeat this action to add HIB.C to the
  1667.  program list. (A second option is to type the file names in the text box at
  1668.  the top of the screen.) When you're finished, press TAB until the Save List
  1669.  command button is highlighted, and then press ENTER.
  1670.  
  1671.  Click HIA.C once and click the Add/Delete button (or just double-click
  1672.  HIA.C). Do the same for HIB.C. When both programs appear in the program
  1673.  list, click the Save List command button to save the make file.
  1674.  
  1675.  This program list tells QuickC that several source files are to be combined
  1676.  into one program.
  1677.  
  1678.  ────────────────────────────────────────────────────────────────────────────
  1679.  NOTE
  1680.  
  1681.  Within a program list, you can include source files (ending with the .C
  1682.  extension), object files (.OBJ), or libraries (.LIB). For example, if you
  1683.  didn't include graphics in the combined library when you ran the SETUP
  1684.  program, you can place GRAPHICS.LIB in the program list to gain access to
  1685.  graphics functions.
  1686.  ────────────────────────────────────────────────────────────────────────────
  1687.  
  1688.  Notice that the base name of the program list (HIA.MAK) matches the name of
  1689.  one of the source files (HIA.C). Because the names match, when you load
  1690.  HIA.C in the future, QuickC will ask if you wish to use the program list
  1691.  HIA.MAK. You don't have to give the source file and the make file the same
  1692.  names, but it's a good idea to do so.
  1693.  
  1694.  The order that you list the files is inconsequential. It doesn't matter
  1695.  which file is first or second.
  1696.  
  1697.  When you choose the Rebuild All command from the Make menu, every .C file in
  1698.  the program list is compiled into a .OBJ file. Then all of the .OBJ files
  1699.  are linked with .LIB files to create one .EXE file.
  1700.  
  1701.  However, if you press SHIFT+F5 or choose the Build Program command, QuickC
  1702.  checks the time and date stamps on the source and object files. If the
  1703.  source code has not changed since the last time a Build Program command
  1704.  executed, there's no need to recompile the unchanged .OBJ files. Any files
  1705.  that have changed are recompiled; the others are not. This means the Build
  1706.  command is often faster than the Rebuild All command when you have multiple
  1707.  source files.
  1708.  
  1709.  
  1710.  About Directories
  1711.  
  1712.  You can change directories whenever you open or save a file:
  1713.  
  1714.  Press TAB until the cursor is within the Drives/Dirs: list box containing
  1715.  the directory names (see Figure 3.4). Use the arrow keys to move to the
  1716.  desired directory, and press ENTER.
  1717.  
  1718.  Double-click the name of the desired directory.
  1719.  
  1720.  To move to the parent directory, select the two periods (..) at the top of
  1721.  the list.
  1722.  
  1723.  When you exit QuickC, you return to the directory you started (the default
  1724.  directory), regardless of how many other directories you may have accessed.
  1725.  
  1726.  
  1727.  QuickC puts all object (.OBJ) files and executable (.EXE) files in the
  1728.  default directory. For example, suppose you run QuickC from the C:\ZEBRA
  1729.  directory and open the file TAPIR.C from the C:\AARDVARK directory. Because
  1730.  ZEBRA is the default directory, the files TAPIR.OBJ and TAPIR.EXE are
  1731.  created in the ZEBRA directory when you compile the program. If you prefer
  1732.  to keep all related files in the AARDVARK directory, choose the Run DOS
  1733.  Command from the Utility menu and type
  1734.  
  1735.    CHDIR \AARDVARK
  1736.  
  1737.  The CHDIR directory command redirects the object and executable files to the
  1738.  other directory.
  1739.  
  1740.  
  1741.  Compiling and Linking from the Command Line
  1742.  
  1743.  If you're new to the C language, you can skip this section. You don't need
  1744.  to know how to compile and link from the command line; you can do everything
  1745.  within the QuickC environment.
  1746.  
  1747.  However, if you want to, you can exit the QuickC environment to build
  1748.  programs from the DOS prompt. This gives you slightly more control over the
  1749.  various options. In addition, if you're building a series of related
  1750.  executable programs, you can either put the compile and link commands in a
  1751.  batch file or create your own make file. Either method is faster than
  1752.  building programs individually.
  1753.  
  1754.  The program that builds from the command line is called QCL.EXE (the C and L
  1755.  in the file name stand for "Compile" and "Link"). To build the HI.EXE
  1756.  program, type this:
  1757.  
  1758.    QCL HI.C
  1759.  
  1760.  You can include a variety of command-line options between QCL and the file
  1761.  name. For example,
  1762.  
  1763.    QCL /AM HI.C
  1764.  
  1765.  forces the linker to use the medium memory model (the default is the small
  1766.  model). If you try this example, you must have a medium memory model library
  1767.  installed. You will find a complete list of compiler and linker options in
  1768.  the Microsoft QuickC Tool Kit manual (or type  QCL /help).
  1769.  
  1770.  QCL can also build multiple-module programs. Since HIA.C and HIB.C are two
  1771.  parts of a multiple-module program, the following line does not build a
  1772.  program:
  1773.  
  1774.    QCL HIA.C
  1775.  
  1776.  The compiler works correctly, creating a .OBJ file, but when the linker
  1777.  looks for the  outsider  function (which is in HIB.C), it fails and returns
  1778.  the error unresolved external.
  1779.  
  1780.  One solution is to specify both source files:
  1781.  
  1782.    QCL HIA.C HIB.C
  1783.  
  1784.  The example above builds a program called HIA.EXE because HIA.C is listed
  1785.  first.
  1786.  
  1787.  Another solution is to compile the two files and then link them yourself:
  1788.  
  1789.    QCL /c HIA.C
  1790.    QCL /c HIB.C
  1791.    QLINK HIA.OBJ HIB.OBJ
  1792.  
  1793.  The /c option tells the QCL program to compile but not link. It must be
  1794.  entered as a lowercase character.
  1795.  
  1796.  Since you created a make file called HIA.MAK, which contained the program
  1797.  list, you can also use the NMAKE program to build HIA.EXE. Simply pass it
  1798.  the name of the make file:
  1799.  
  1800.    NMAKE /F HIA.MAK
  1801.  
  1802.  For a complete list of compiler, linker, and NMAKE options, see Microsoft
  1803.  QuickC Tool Kit.
  1804.  
  1805.  The -qc option allows you to run the QuickC compiler from Microsoft C
  1806.  Professional Development System version 6.0. To use the QuickC compiler from
  1807.  Microsoft C use the command line
  1808.  
  1809.    CL = B1 qccom -qc
  1810.  
  1811.  QuickC ships with the QLINK linker, a subset of LINK.
  1812.  
  1813.  
  1814.  The Debugger
  1815.  
  1816.  When you make obvious mistakes like misspelling a function name or
  1817.  forgetting to end a line with a semicolon, your code causes a compile-time
  1818.  error. The compiler (or linker) refuses to continue until you fix the
  1819.  mistake.
  1820.  
  1821.  Other mistakes cause run-time errors. Attempting to divide by zero is one
  1822.  such example.
  1823.  
  1824.  Still other mistakes are called logic errors. When a program includes a
  1825.  logic error, it may run, but it eventually acts unpredictably or yields
  1826.  incorrect results.
  1827.  
  1828.  QuickC's built-in debugger helps you track down and correct logic errors. In
  1829.  the Run menu, you'll find Trace Into and Step Over, which execute the
  1830.  program in memory line by line. Trace Into follows functions when they're
  1831.  called; Step Over lets you execute a function without showing its inner
  1832.  workings.
  1833.  
  1834.  You can use the Debug menu to set watchpoints and breakpoints and run a
  1835.  program up to the breakpoint.
  1836.  
  1837.  The Watch Value command from the Debug menu is also useful. You enter one or
  1838.  more variable names and then monitor their values as you step through the
  1839.  program. There's no need to place printf statements at various points in a
  1840.  program just to monitor the value of a variable. The Quickwatch command
  1841.  gives you even faster access to variables or expressions you want to watch.
  1842.  
  1843.  
  1844.  If you turn on Debugging History, the debugger records everything that
  1845.  happens during the session. Later, you can review the events and watch for
  1846.  the logic error.
  1847.  
  1848.  The online tutorial includes a lesson explaining how to use the debugger,
  1849.  with a special section devoted to using Debugging History. If you're
  1850.  interested in exploring this topic, run the LEARN program from the command
  1851.  line or choose the Learn QuickC command from the Utility menu. You can also
  1852.  consult online help for detailed information about the debugger.
  1853.  
  1854.  ────────────────────────────────────────────────────────────────────────────
  1855.  IMPORTANT
  1856.  
  1857.  The CodeView debugger cannot handle files that have been incrementally
  1858.  compiled or incrementally linked. If you plan to examine QuickC programs
  1859.  with CodeView, be sure the incremental compiling and linking options are
  1860.  turned off. From the command line, use QCL without the /Gi or /Li options.
  1861.  From the QuickC environment, use the Make command from the Options menu to
  1862.  turn off incremental compiling and linking and to turn on CodeView info.
  1863.  This restriction applies only to CodeView. QuickC's built-in debugger can
  1864.  handle incrementally compiled and linked programs.
  1865.  ────────────────────────────────────────────────────────────────────────────
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  Chapter 4  Getting Help
  1873.  ────────────────────────────────────────────────────────────────────────────
  1874.  
  1875.  The QuickC Compiler environment offers a complete online reference system
  1876.  called the Microsoft Advisor. The Microsoft Advisor provides information on
  1877.  the C language, run-time libraries, and utilities provided with QuickC.
  1878.  
  1879.  The first section of this chapter, "Structure of the Microsoft Advisor,"
  1880.  outlines the structure and contents of the help database. The second
  1881.  section, "Navigating through the Microsoft Advisor," takes you on a quick
  1882.  tour of the system.
  1883.  
  1884.  
  1885.  Structure of the Microsoft Advisor
  1886.  
  1887.  The Microsoft Advisor can be compared to a librarian managing a collection
  1888.  of books. Each book, or help file, has its own table of contents, index, and
  1889.  pages of information. The Advisor organizes the books with an overall table
  1890.  of contents and index. All of the books are listed, and their specific
  1891.  tables of contents and indexes can be accessed through the overall
  1892.  references. The global contents screen is shown in Figure 4.1.
  1893.  
  1894.  (This figure may be found in the printed book.)
  1895.  
  1896.  You can access a variety of information from the online reference system.
  1897.  Information regarding the C language, run-time libraries, errors, and the
  1898.  reference system itself can all be displayed.
  1899.  
  1900.  
  1901.  Navigating through the Microsoft Advisor
  1902.  
  1903.  You request information about a topic in a window by positioning the cursor
  1904.  over it and pressing F1. The help system then searches through the help
  1905.  files for information about the topic. If it finds the topic, the help
  1906.  system displays information in the Help window. If help cannot be found for
  1907.  a particular word or symbol, a message informs you that no information is
  1908.  associated with the topic. Sometimes, a topic with the same name occurs in
  1909.  several help files. In such cases, a dialog box is displayed in which you
  1910.  can select the context of the topic.
  1911.  
  1912.  
  1913.  Using the Help Menu
  1914.  
  1915.  The simplest method for accessing the online reference is with the commands
  1916.  found in the Help menu. All of these commands present information in the
  1917.  Help window.
  1918.  
  1919.  Command                           Description
  1920.  ────────────────────────────────────────────────────────────────────────────
  1921.  Index                             Displays the alphabetical index of
  1922.                                    help-file categories (see Figure 4.2).
  1923.  
  1924.  Contents                          Displays the global contents screen for
  1925.                                    the categories found in the help files.
  1926.  
  1927.  Topic:                            Provides information about the topic
  1928.                                    that the cursor is currently positioned
  1929.                                    over. If information about the topic is
  1930.                                    available, the topic's name is appended
  1931.                                    to the Topic: command. Otherwise, this
  1932.                                    menu option is grayed.
  1933.  
  1934.  Help on Help                      Displays information about using the
  1935.                                    online reference itself.
  1936.  
  1937.  (This figure may be found in the printed book.)
  1938.  
  1939.  ────────────────────────────────────────────────────────────────────────────
  1940.  NOTE
  1941.  
  1942.  SHIFT+F1 is the shortcut key for the Help on Help menu command. If you have
  1943.  a terminate-and-stay-resident (TSR) utility such as the Norton Guides(tm)
  1944.  installed and you invoke that program with SHIFT+F1, then you can't use
  1945.  SHIFT+F1 as a shortcut to Help on Help. Choose Help on Help from the Help
  1946.  menu instead, or change the key that invokes the TSR.
  1947.  ────────────────────────────────────────────────────────────────────────────
  1948.  
  1949.  
  1950.  Using the F1 Key
  1951.  
  1952.  You can use the F1 key to get information about any menu command or QuickC
  1953.  dialog box, as well as information on C keywords, operators, and library
  1954.  functions.
  1955.  
  1956.  
  1957.  Menu Help
  1958.  
  1959.  To view information about a menu item, first pull down the menu, then
  1960.  
  1961.  Use the cursor keys to highlight the command and press F1.
  1962.  
  1963.  Move the mouse cursor on the command and click the Right mouse button.
  1964.  
  1965.  Figure 4.3 shows the help information for the Cut command in the Edit menu.
  1966.  
  1967.  
  1968.  (This figure may be found in the printed book.)
  1969.  
  1970.  
  1971.  Keyword and Library-Function Help
  1972.  
  1973.  To view information about a C keyword, operator, or run-time library
  1974.  function,
  1975.  
  1976.  Put the cursor on the keyword or function name and press F1.
  1977.  
  1978.  Click on the command with the Right mouse button.
  1979.  
  1980.  
  1981.  Dialog-Box Help
  1982.  
  1983.  To view information about a QuickC dialog box, simply press F1 while the
  1984.  dialog box is displayed, or click on the Help button.
  1985.  
  1986.  
  1987.  Using Hyperlinks
  1988.  
  1989.  Hyperlinks are cross-references that connect related topic information.
  1990.  
  1991.  Hyperlinks enclosed by the < and > characters are called "buttons." Navigate
  1992.  through the online help system by using these buttons.
  1993.  
  1994.  You can press TAB to move to the next hyperlink button within the current
  1995.  help window. SHIFT+TAB moves back to the previous button. Typing any letter
  1996.  moves the cursor to the next button that begins with the letter; holding
  1997.  SHIFT down and typing a letter moves the cursor backward.
  1998.  
  1999.  The Microsoft Advisor also recognizes C keywords, library functions,
  2000.  constants defined by QuickC, and similar identifiers as hyperlinks, but they
  2001.  are unmarked hyperlinks. Unmarked hyperlinks are recognized by the Microsoft
  2002.  Advisor wherever they appear in the help-information text or in your source
  2003.  code. However, an unmarked hyperlink is not delimited with the < and >
  2004.  characters, and you can't move to it with the TAB key. An unmarked hyperlink
  2005.  can only be executed by placing the cursor on it and pressing F1, or
  2006.  pointing to it with the mouse cursor and clicking the Right mouse button.
  2007.  
  2008.  You can access a hyperlink in several ways. First move either the mouse or
  2009.  text cursor to a hyperlink, then
  2010.  
  2011.  Press F1.
  2012.  
  2013.  Click the Left mouse button twice (double-click). Then click the Right mouse
  2014.  button once.
  2015.  
  2016.  Highlighted button hyperlinks can also be executed by pressing ENTER or the
  2017.  SPACEBAR.
  2018.  
  2019.  Any of these actions displays information about the topic the cursor is
  2020.  positioned on. If the topic isn't a hyperlink, a message informs you that no
  2021.  information on the topic could be found.
  2022.  
  2023.  
  2024.  Using Help Windows and Dialog Boxes
  2025.  
  2026.  The Microsoft Advisor displays information in windows or dialog boxes. Help
  2027.  windows and dialog boxes function the same as other QuickC windows and
  2028.  dialog boxes. For a complete description of windows and dialog boxes, refer
  2029.  to Chapter 3, "Using QuickC."
  2030.  
  2031.  
  2032.  Using the Help Window
  2033.  
  2034.  The help window displays various contents, indexes, and information about
  2035.  selected topics. Some screens of information are larger than the help
  2036.  window; information beyond the window borders can be viewed by using the
  2037.  scroll bars or the arrow keys. The  -  -  symbol indicates the end of
  2038.  information in the help  window.
  2039.  
  2040.  
  2041.  Navigating with Hyperlink Buttons
  2042.  
  2043.  At the top of the Help window is a group of hyperlink buttons that are
  2044.  useful for moving through the reference system:
  2045.  
  2046.  Button                            Description
  2047.  ────────────────────────────────────────────────────────────────────────────
  2048.  < Up >                            Moves upward in the hierarchy of help
  2049.                                    screens. Since information is ordered in
  2050.                                    a logical way, moving from the general
  2051.                                    to the specific, this command is useful
  2052.                                    for moving up the information tree.
  2053.  
  2054.  < Contents >                      Displays the global contents screen.
  2055.                                    This command is useful because it always
  2056.                                    returns you to a known point in the
  2057.                                    online help system hierarchy.
  2058.  
  2059.  < Index >                         Displays the index list. Selecting a
  2060.                                    letter from the list displays the index
  2061.                                    for entries beginning with that
  2062.                                    letter.
  2063.  
  2064.  < Back >                          Moves you to the last online help screen
  2065.                                    you saw.
  2066.  
  2067.  Screens on a particular topic frequently are physically grouped together in
  2068.  a help file. You can press CTRL+F1 to display information about the next
  2069.  physical topic in the help file.
  2070.  
  2071.  
  2072.  Viewing the Previous Help Screen
  2073.  
  2074.  The Microsoft Advisor remembers the last 20 help screens you've accessed. To
  2075.  return to a previous screen, use the "Back" button or hold down the ALT key
  2076.  and press F1 as many times as necessary to return to the screen you want to
  2077.  see. The help screen that appears is active; you can ask for help on any of
  2078.  its hyperlinks or topics.
  2079.  
  2080.  You can always return to the global contents screen by pressing SHIFT+F1.
  2081.  
  2082.  
  2083.  Copying and Pasting Information
  2084.  
  2085.  Any text that appears in the help window can easily be copied to another
  2086.  window. For example, to test an example program from the help window, you
  2087.  only have to copy it to the source window and compile it.
  2088.  
  2089.  To copy and paste with the keyboard, follow these steps:
  2090.  
  2091.  
  2092.    1.  Move the cursor to the beginning or the end of the text you want to
  2093.        select. Hold down the SHIFT key and move the cursor to the other end
  2094.        of the text. The text is now highlighted.
  2095.  
  2096.    2.  Execute the Copy command: press ALT to activate the menus, E for Edit,
  2097.        then C for Copy. Note that the menu lists the shortcut command
  2098.        (CTRL+INS), which can be substituted for ALT+E, then C.
  2099.  
  2100.    3.  Press F6 to switch to another window. Position the cursor where you
  2101.        want to insert the text, and execute the Paste command: ALT+E, then P,
  2102.        or use the SHIFT+INS shortcut. The text from the help window is
  2103.        inserted at the current cursor position.
  2104.  
  2105.  
  2106.  To copy and paste using the mouse, follow these steps:
  2107.  
  2108.  
  2109.    1.  Click the Left mouse button and drag the cursor (hold the button down
  2110.        while moving the mouse) to select the text you want to copy.
  2111.  
  2112.    2.  Choose Copy from the Edit menu (or press CTRL+INS).
  2113.  
  2114.    3.  Move the mouse cursor to the location where you want to insert the
  2115.        text, and click once. Then choose Paste from the Edit menu. The text
  2116.        from the help window is inserted at the current cursor position.
  2117.  
  2118.  
  2119.  
  2120.  Closing the Help Window
  2121.  
  2122.  Once you're through working with the online reference system, close the
  2123.  active help window and return to the source window:
  2124.  
  2125.  Press ESC.
  2126.  
  2127.  Click the Close button in the upper left corner of the window with the Left
  2128.  mouse button.
  2129.  
  2130.  
  2131.  Using Help Dialog Boxes
  2132.  
  2133.  Help dialog boxes contain information about menu commands and their dialog
  2134.  boxes. A help dialog box differs from a help window in that it is displayed
  2135.  over the source window and any other windows that are displayed. Unlike the
  2136.  help window, a help dialog box must be closed before you can execute any
  2137.  menu commands. The Cancel button in the lower right portion of the dialog
  2138.  box closes the help dialog box.
  2139.  
  2140.  To view information about any QuickC dialog box, you can
  2141.  
  2142.  Press F1.
  2143.  
  2144.  Click the Help button in the dialog box with the Left mouse button.
  2145.  
  2146.  Either of these commands causes a help dialog box to appear. To close a help
  2147.  dialog box,
  2148.  
  2149.  Press F1.
  2150.  
  2151.  Click the dialog box's Cancel button by using the Left mouse button.
  2152.  
  2153.  
  2154.  Accessing Different Types of Information
  2155.  
  2156.  This section presents some strategies for accessing the different types of
  2157.  information available within the online reference system.
  2158.  
  2159.  
  2160.  Keyword Information
  2161.  
  2162.  To get information about any keyword, operator, symbolic constant, or
  2163.  library function, go to the index, select the keyword's first letter, then
  2164.  scroll down the list of entries and select the topic hyperlink. If you know
  2165.  the exact name of a keyword, it is often quicker to simply type it in the
  2166.  source window and press F1 than to locate it through an index.
  2167.  
  2168.  Figure 4.4 shows the information screen for the printf function.
  2169.  
  2170.  (This figure may be found in the printed book.)
  2171.  
  2172.  When information about a function is displayed in the help window, two
  2173.  additional hyperlink buttons are displayed.
  2174.  
  2175.  
  2176.    ■   <Description> provides a detailed explanation of the function. When
  2177.        the information is displayed, the button changes to <Summary>,
  2178.        allowing you to return to the summarized information about the
  2179.        function.
  2180.  
  2181.    ■   <Example> displays C source code that provides an example of how the
  2182.        function is used. The code can be pasted into the source window to
  2183.        compile.
  2184.  
  2185.  
  2186.  
  2187.  Topical Information
  2188.  
  2189.  The online reference system is useful when you want an overview of the
  2190.  available reference topics, or when you only have a general idea of what
  2191.  information you need. Start with the global contents screen, then select any
  2192.  hyperlinks that appear to relate to the topic. You can traverse the
  2193.  hyperlinks until you locate the necessary information.
  2194.  
  2195.  
  2196.  Menu and Dialog-Box Information
  2197.  
  2198.  You can get information about any menu command or dialog box by pressing F1
  2199.  when the menu command is highlighted or the dialog box is displayed. This is
  2200.  helpful when you are first learning to use QuickC, and may not be completely
  2201.  familiar with all of the features.
  2202.  
  2203.  
  2204.  Error Information
  2205.  
  2206.  The Microsoft Advisor provides information about compiler and linker error
  2207.  messages.
  2208.  
  2209.  To find the meaning of an error message using the keyboard,
  2210.  
  2211.  
  2212.    1.  Press F6 to move the cursor to the error window
  2213.  
  2214.    2.  Position the cursor on the error number
  2215.  
  2216.    3.  Press F1
  2217.  
  2218.  
  2219.  Or:
  2220.  
  2221.  
  2222.    1.  Position the mouse cursor on the error number
  2223.  
  2224.    2.  Click the Right mouse button
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  Chapter 5  Where to Go from Here
  2233.  ────────────────────────────────────────────────────────────────────────────
  2234.  
  2235.  You've installed the QuickC Compiler on your system and tried a sample
  2236.  editing session. What you do next depends on your level of experience. You
  2237.  can experiment, or you can further investigate some of the other books in
  2238.  this package.
  2239.  
  2240.  
  2241.  Read README.DOC
  2242.  
  2243.  The README.DOC file lists all known corrections and additions to the printed
  2244.  manuals. Before you continue, please read this file. You can view it from
  2245.  within online help or you can use the QuickC editor (type  QC README.DOC  to
  2246.  read the file).
  2247.  
  2248.  
  2249.  For All Programmers
  2250.  
  2251.  The QuickC environment has been designed with you, the programmer, in mind.
  2252.  You'll find writing, compiling, and debugging QuickC programs faster and
  2253.  easier than ever. To learn more about the editor, compiler, linker, and
  2254.  debugger, you should run the disk-based tutorial on the QuickC distribution
  2255.  disk labeled "Learning the Microsoft QuickC Integrated Environment."
  2256.  
  2257.  The \QC2\TUTORIAL directory holds the tutorial program, LEARN.COM. The LEARN
  2258.  program contains four lessons:
  2259.  
  2260.  
  2261.    1.  How to Use This Tutorial
  2262.  
  2263.    2.  Getting Around in QuickC
  2264.  
  2265.    3.  Creating Programs in QuickC
  2266.  
  2267.    4.  Debugging in QuickC
  2268.  
  2269.  
  2270.  You can run LEARN from the command line or choose the Learn QuickC command
  2271.  from the Utility menu.
  2272.  
  2273.  QuickC searches the current path and runs the first LEARN.COM program it
  2274.  finds. If it finds a LEARN.COM for another program, such as Microsoft Word,
  2275.  QuickC will run that LEARN program instead of the one for QuickC.
  2276.  
  2277.  If this happens while you are working from the command line, either switch
  2278.  to the \QC2\TUTORIAL directory and type LEARN, and press ENTER, or run the
  2279.  NEW-VARS batch file.
  2280.  
  2281.  ────────────────────────────────────────────────────────────────────────────
  2282.  NOTE
  2283.  
  2284.  Since most of the changes to QuickC 2.5 are language additions that don't
  2285.  affect the QuickC environment or the operation of the compiler or linker,
  2286.  the LEARN tutorial program has not been updated to include changes found in
  2287.  version 2.5.
  2288.  ────────────────────────────────────────────────────────────────────────────
  2289.  
  2290.  
  2291.  For Programmers New to the C Language
  2292.  
  2293.  The book C for Yourself was written for people who already know how to
  2294.  program (in BASIC, Pascal, or some other language) but have never used C.
  2295.  Part 1, "Learning C," covers everything from functions to flow control and
  2296.  from data types to pointers. If you've never programmed in C or if you need
  2297.  a refresher course, start with C for Yourself.
  2298.  
  2299.  The introduction in C for Yourself lists several additional books that
  2300.  newcomers to C may find helpful.
  2301.  
  2302.  Another good source of information about how C works is the online help
  2303.  system. Prototypes, explanations, and examples for any function are
  2304.  immediately available at the press of a key. You may ask for help about a
  2305.  specific topic or browse through the contents screen.
  2306.  
  2307.  
  2308.  For C Programmers New to QuickC
  2309.  
  2310.  Appendix A of C for Yourself  is a quick reference to the QuickC
  2311.  implementation of C. Both the proposed ANSI standard and the original
  2312.  Kernighan & Ritchie standard are supported.
  2313.  
  2314.  Appendix B of C for Yourself summarizes the most useful QuickC library
  2315.  functions, listing the header files to include, values to pass, and values
  2316.  returned.
  2317.  
  2318.  For specific details on the compiling, linking, library, and other support
  2319.  programs, see Microsoft QuickC Tool Kit.
  2320.  
  2321.  
  2322.  For QuickC Programmers New to Version 2.5
  2323.  
  2324.  If you've used an older version of QuickC, you should read Appendix B of
  2325.  this book. It lists features that were added to both QuickC version 2.0 and
  2326.  the current 2.5 version.
  2327.  
  2328.  Advanced C topics and features unique to QuickC are covered in C for
  2329.  Yourself. Part 2, "Using C," includes detailed information about the new
  2330.  functions such as real coordinate graphics, presentation graphics, fonts,
  2331.  and in-line assembly. If you've previously used version 1.0 of QuickC, we
  2332.  recommend that you read through Part 2 of C for Yourself. In addition,
  2333.  Appendix B, "C Library Guide," summarizes commonly used functions in the
  2334.  QuickC run-time library.
  2335.  
  2336.  
  2337.  Additional Tools
  2338.  
  2339.  QuickC offers more than just an integrated editor, compiler, and linker.
  2340.  Additional utilities include the QCL program (for compiling from the DOS
  2341.  command line), the LINK program (for linking object modules), the NMAKE
  2342.  program (for automating the compile/link process and maintaining programs),
  2343.  and the LIB program (for creating your own libraries).
  2344.  
  2345.  Microsoft QuickC Tool Kit explains how to use these advanced tools to best
  2346.  advantage. Part 1, "Tool Kit Tutorial," is a tutorial that explains
  2347.  step-by-step how these programs work. Part 2, "Reference to QuickC Tools,"
  2348.  is a complete and exhaustive reference guide that summarizes the many
  2349.  options.
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  Appendix A  Editor Functions
  2357.  ────────────────────────────────────────────────────────────────────────────
  2358.  
  2359.  This appendix has two parts. The first part, Table A.1, lists the keystrokes
  2360.  that invoke commands within the QuickC Compiler Editor and three other
  2361.  editors. The second part, Table A.2, lists the editor functions
  2362.  alphabetically and defines them.
  2363.  
  2364.  Each editor has its own .KEY file. Chapter 3, "Using QuickC," explains how
  2365.  to use the /k: option to load one of the four .KEY files supplied with
  2366.  QuickC. It also contains directions for using MKKEY.EXE to customize the
  2367.  commands within a .KEY file. Functions are not assigned default values. If
  2368.  you omit Backspace from your customized .KEY file, you will be unable to
  2369.  backspace.
  2370.  
  2371.  Note that in Table A.1 below, the plus sign indicates that both keys should
  2372.  be held down. For example, CTRL+H means that you hold down the CTRL key
  2373.  while you press H. When keys are pressed separately, they are separated with
  2374.  a comma. For example, ESC, D means that you press (and release) ESC and then
  2375.  press the D key.
  2376.  
  2377.  The CAPS LOCK key affects individual keystrokes, but not CTRL or ALT
  2378.  sequences. Holding down the SHIFT key defines a block of text.
  2379.  
  2380.  Table   A.1 Editor Keystrokes
  2381.  
  2382. ╓┌──────────┌──────────────────┌─────────────┌──────────┌────────────────────╖
  2383.  Function   QuickC             Microsoft     BRIEF(R)   Epsilon
  2384.  ────────────────────────────────────────────────────────────────────────────
  2385.  Backspace  CTRL+H             CTRL+H        CTRL+H     ─
  2386.  
  2387.  BegLine    CTRL+Q, CTRL+S     ─             ─          ─
  2388.             CTRL+Q, S
  2389.  
  2390.  BegPgm     CTRL+HOME          ALT+A, PGUP   CTRL+PGUP  CTRL+HOME
  2391.             CTRL+Q, CTRL+R                              ESC, <
  2392.             CTRL+Q, R
  2393.  
  2394.  Cancel     ESC                ESC           ESC        F12
  2395.  
  2396.  Function   QuickC             Microsoft     BRIEF(R)   Epsilon
  2397.  ────────────────────────────────────────────────────────────────────────────
  2398. 
  2399.  Cancel2    F12                F12           F12        ESC
  2400.  
  2401.  Change     CTRL+Q, CTRL+A     CTRL+L        ALT+T      ESC, %
  2402.             CTRL+Q, A          CTRL+\
  2403.  
  2404.  
  2405.  
  2406.  Table   A.1 (continued)
  2407.  
  2408. ╓┌─────────────────┌─────────────────┌──────────────┌──────────┌─────────────
  2409.  Function          QuickC            Microsoft      BRIEF(R)   Epsilon
  2410.  ─────────────────────────────────────────────────────────────────────────────
  2411.  CharLeft          CTRL+S            CTRL+S         LEFT       CTRL+B
  2412.                    LEFT                                        LEFT
  2413.  
  2414.  CharRight         CTRL+D            CTRL+D         RIGHT      CTRL+F
  2415.                    RIGHT                                       RIGHT
  2416.  
  2417.  Function          QuickC            Microsoft      BRIEF(R)   Epsilon
  2418.  ─────────────────────────────────────────────────────────────────────────────
  2419. 
  2420.  Del               DEL               DEL            DEL        DEL
  2421.                    CTRL+G            CTRL+G                    CTRL+D
  2422.  
  2423.  DelWord           CTRL+T                                      ALT+D
  2424.                                                                ESC, D
  2425.  
  2426.  DoEsc             ESC               ─              ─          ─
  2427.  
  2428.  DoQuoteCharacter  CTRL+P            CTRL+P         ALT+Q      CTRL+Q
  2429.  
  2430.  DoTab             TAB               TAB            TAB        TAB
  2431.                    ALT+TAB                                     ALT+TAB
  2432.  
  2433.  EndLine           END               END            END        END
  2434.                    CTRL+Q, CTRL+D                              CTRL+E
  2435.                    CTRL+Q, D
  2436.  
  2437.  EndPgm            CTRL+END          ALT+A, PGDN    CTRL+PGDN  CTRL+END
  2438.  Function          QuickC            Microsoft      BRIEF(R)   Epsilon
  2439.  ─────────────────────────────────────────────────────────────────────────────
  2440. EndPgm            CTRL+END          ALT+A, PGDN    CTRL+PGDN  CTRL+END
  2441.                    CTRL+Q, CTRL+C                              ESC, >
  2442.                    CTRL+Q, C
  2443.  
  2444.  EndScn            CTRL+Q, CTRL+X    ALT+A, DOWN    CTRL+DOWN  ─
  2445.                    CTRL+Q, X
  2446.  
  2447.  EraseEol          CTRL+Q, CTRL+Y    ALT+A, CTRL+Y  ALT+K      CTRL+K
  2448.                    CTRL+Q, Y
  2449.  
  2450.  Find              CTRL+Q, CTRL+F    ─              ALT+S      CTRL+S
  2451.                    CTRL+Q, F
  2452.  
  2453.  GotoBookmark0     CTRL+Q, 0         ─              ─          ─
  2454.  
  2455.  GotoBookmark1     CTRL+Q, 1         ─              ─          ─
  2456.  
  2457.  
  2458.  
  2459.  Table   A.1 (continued)
  2460.  
  2461. ╓┌───────────────┌───────────────┌───────────┌──────────┌────────────────────╖
  2462.  Function        QuickC          Microsoft   BRIEF(R)   Epsilon
  2463.  ────────────────────────────────────────────────────────────────────────────
  2464.  GotoBookmark2   CTRL+Q, 2       ─           ─          ─
  2465.  
  2466.  GotoBookmark3   CTRL+Q, 3       ─           ─          ─
  2467.  
  2468.  HomeLine        HOME            HOME        HOME       HOME
  2469.                                                         CTRL+A
  2470.  
  2471.  HomeScn         CTRL+Q, CTRL+E  ALT+A, UP   CTRL+HOME  ─
  2472.                  CTRL+Q, E
  2473.  
  2474.  KillLine        CTRL+Y          CTRL+Y      ALT+D      ─
  2475.  
  2476.  LineDown        DOWN            DOWN        DOWN       DOWN
  2477.                  CTRL+X          CTRL+X                 CTRL+N
  2478.  
  2479.  LineUp          UP              UP          UP         UP
  2480.  Function        QuickC          Microsoft   BRIEF(R)   Epsilon
  2481.  ────────────────────────────────────────────────────────────────────────────
  2482. LineUp          UP              UP          UP         UP
  2483.                  CTRL+E          CTRL+E                 CTRL+P
  2484.  
  2485.  MatchBrace      CTRL+]          ─           ─          CTRL+]
  2486.  
  2487.  Menu            ALT             F11         ALT        ALT
  2488.  
  2489.  Menu2           F11             ALT+M       F11        F11
  2490.  
  2491.  NewLine         CTRL+M          CTRL+M      CTRL+M     CTRL+M
  2492.  
  2493.  NextLine        CTRL+J          ─           ─          CTRL+J
  2494.  
  2495.  PageDown        PGDN            PGDN        PGDN       PGDN
  2496.                  CTRL+C          CTRL+C                 CTRL+V
  2497.  
  2498.  PageLeft        CTRL+PGUP       ─           ─          CTRL+PGUP
  2499.  
  2500.  PageRight       CTRL+PGDN       ─           ─          CTRL+PGDN
  2501.  Function        QuickC          Microsoft   BRIEF(R)   Epsilon
  2502.  ────────────────────────────────────────────────────────────────────────────
  2503. PageRight       CTRL+PGDN       ─           ─          CTRL+PGDN
  2504.  
  2505.  PageUp          PGUP            PGUP        PGUP       PGUP
  2506.                  CTRL+R          CTRL+R                 ALT+V
  2507.                                                         ESC, V
  2508.  
  2509.  ResetState      CTRL+K, CTRL+U  ─           ─          ─
  2510.                  CTRL+Q, CTRL+U
  2511.                  CTRL+U
  2512.  
  2513.  ScrollDown      CTRL+Z,         CTRL+Z      CTRL+D     CTRL+Z CTRL+DOWN
  2514.                  CTRL+DOWN
  2515.  
  2516.  
  2517.  
  2518.  Table   A.1 (continued)
  2519.  
  2520. ╓┌─────────────────┌─────────────────┌─────────────────┌───────────┌─────────
  2521.  Function          QuickC            Microsoft         BRIEF(R)    Epsilon
  2522.  Function          QuickC            Microsoft         BRIEF(R)    Epsilon
  2523.  ─────────────────────────────────────────────────────────────────────────────
  2524.  ScrollUp          CTRL+UP           CTRL+W            CTRL+U      CTRL+UP
  2525.                    CTRL+W                                          ESC, Z
  2526.                                                                    F4
  2527.  
  2528.  SearchNext        CTRL+L            ─                 ─           ─
  2529.  
  2530.  SetBookMark0      CTRL+K, 0         ─                 ALT+M       ─
  2531.  
  2532.  SetBookMark1      CTRL+K, 1         ─                 ─           ─
  2533.  
  2534.  SetBookMark2      CTRL+K, 2         ─                 ─           ─
  2535.  
  2536.  SetBookMark3      CTRL+K, 3         ─                 ─           ─
  2537.  
  2538.  SplitLine         CTRL+N            CTRL+N            ─           CTRL+O
  2539.  
  2540.  ToggleInsertMode  INS               INS               ALT+I       INS
  2541.                    CTRL+V            CTRL+V
  2542.  
  2543.  Function          QuickC            Microsoft         BRIEF(R)    Epsilon
  2544.  ─────────────────────────────────────────────────────────────────────────────
  2545. 
  2546.  Undo              CTRL+Q, CTRL+L    ALT+H             ALT+U       ─
  2547.                    CTRL+Q, L
  2548.  
  2549.  WordLeft          CTRL+LEFT         CTRL+LEFT         CTRL+LEFT   CTRL+LEFT
  2550.                    CTRL+A            CTRL+A                        ALT+B
  2551.                                                                    ESC, B
  2552.  
  2553.  WordRight         CTRL+RIGHT        CTRL+RIGHT        CTRL+RIGHT  CTRL +RIGHT
  2554.                    CTRL+F            CTRL+F                        ALT+F
  2555.                                                                    ESC, F
  2556.  
  2557.  ─────────────────────────────────────────────────────────────────────────────
  2558.  
  2559.  
  2560.  
  2561.  Table   A.2 Function Definitions
  2562.  
  2563. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  2564.  Function                          Description
  2565.  ────────────────────────────────────────────────────────────────────────────
  2566.  Backspace                         Moves the cursor left and erases the
  2567.                                    character in that position.
  2568.  
  2569.  Beep                              Causes the computer to beep, usually
  2570.                                    when an unassigned key is pressed.
  2571.  
  2572.  BegLine                           Moves the cursor to the beginning of the
  2573.                                    line (column 1), ignoring any
  2574.                                    indentation.
  2575.  
  2576.  BegPgm                            Moves the cursor to the beginning of the
  2577.                                    program (line 1, column 1).
  2578.  
  2579.  Cancel                            Closes help windows and cancels dialog
  2580.                                    boxes.
  2581.  
  2582.  Cancel2                           Cancels dialog boxes.
  2583.  
  2584.  Change                            Searches for selected text and changes
  2585.  Function                          Description
  2586.  ────────────────────────────────────────────────────────────────────────────
  2587. Change                            Searches for selected text and changes
  2588.                                    it to something else.
  2589.  
  2590.  CharLeft                          Moves the cursor one character left.
  2591.  
  2592.  CharRight                         Moves the cursor one character right.
  2593.  
  2594.  Del                               Deletes the character under the cursor.
  2595.  
  2596.  DelWord                           Deletes the word from the current cursor
  2597.                                    position to the next white-space
  2598.                                    character.
  2599.  
  2600.  DoEsc                             Cancels the current selected text.
  2601.  
  2602.  DoQuoteCharacter                  Inserts the next typed character into
  2603.                                    the text (except carriage returns,
  2604.                                    linefeeds, and nulls). This allows you
  2605.                                    to insert characters such as CTRL+C.
  2606.  Function                          Description
  2607.  ────────────────────────────────────────────────────────────────────────────
  2608.                                   to insert characters such as CTRL+C.
  2609.  
  2610.  DoTab                             Indents the entire defined block by one
  2611.                                    tab setting. A shifted DoTab removes the
  2612.                                    tabs from a block.
  2613.  
  2614.  Endline                           Moves the cursor to the last nonspace
  2615.                                    character in the current line.
  2616.  
  2617.  EndPgm                            Moves the cursor to column 1 of the last
  2618.                                    line in the current file.
  2619.  
  2620.  EndScn                            Moves the cursor to the bottom line of
  2621.                                    the current screen. The current column
  2622.                                    is
  2623.                                    maintained.
  2624.  
  2625.  EraseEol                          Erases all characters from the cursor
  2626.                                    position to the end of the line. The
  2627.  Function                          Description
  2628.  ────────────────────────────────────────────────────────────────────────────
  2629.                                   position to the end of the line. The
  2630.                                    characters are placed in the insert
  2631.                                    buffer.
  2632.  
  2633.  Find                              Searches from the current cursor
  2634.                                    position to the end of the file for
  2635.                                    defined text.
  2636.  
  2637.  GotoBookmark0                     Moves the cursor to bookmark 0.
  2638.  
  2639.  GotoBookmark1                     Moves the cursor to bookmark 1.
  2640.  
  2641.  GotoBookmark2                     Moves the cursor to bookmark 2.
  2642.  
  2643.  GotoBookmark3                     Moves the cursor to bookmark 3.
  2644.  
  2645.  
  2646.  
  2647.  Table   A.2 (continued)
  2648.  
  2649. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  2650.  Function                          Description
  2651.  ────────────────────────────────────────────────────────────────────────────
  2652.  HomeLine                          Moves the cursor to the first nonspace
  2653.                                    character on the line.
  2654.  
  2655.  HomeScn                           Moves the cursor to line 1 of the
  2656.                                    current screen, maintaining the current
  2657.                                    column
  2658.                                    position.
  2659.  
  2660.  IgnoreChar                        Does nothing. In addition, the editor
  2661.                                    doesn't beep as it would for undefined
  2662.                                    keys.
  2663.  
  2664.  KillLine                          Erases everything on the current line
  2665.                                    and places the line in the insert buffer.
  2666.  
  2667.  LineDown                          Moves the cursor to the next line.
  2668.  
  2669.  Function                          Description
  2670.  ────────────────────────────────────────────────────────────────────────────
  2671. 
  2672.  LineUp                            Moves the cursor to the previous line.
  2673.  
  2674.  MatchBrace                        Finds matching (parentheses), [square
  2675.                                    brackets], or {curly braces}. The editor
  2676.                                    searches for opening or closing braces,
  2677.                                    depending on which type the cursor is
  2678.                                    resting on.
  2679.  
  2680.  Menu                              Activates the menu bar.
  2681.  
  2682.  Menu2                             Activates the menu bar.
  2683.  
  2684.  NewLine                           Splits the current line into two lines
  2685.                                    at the cursor position. The new line is
  2686.                                    automatically indented to match the line
  2687.                                    above.
  2688.  
  2689.  PageDown                          Moves forward one screen.
  2690.  Function                          Description
  2691.  ────────────────────────────────────────────────────────────────────────────
  2692. PageDown                          Moves forward one screen.
  2693.  
  2694.  PageLeft                          Moves left one screen.
  2695.  
  2696.  PageRight                         Moves one screen to the right (each line
  2697.                                    on a screen may contain up to 255
  2698.                                    characters).
  2699.  
  2700.  PageUp                            Moves back one screen.
  2701.  
  2702.  ResetState                        Cancels prefix tables.
  2703.  
  2704.  ScrollDown                        Scrolls down one line at a time,
  2705.                                    maintaining the current cursor position.
  2706.  
  2707.  ScrollUp                          Scrolls the text up one line at a time,
  2708.                                    maintaining the current cursor position.
  2709.  
  2710.  SearchNext                        Repeats the Find command.
  2711.  Function                          Description
  2712.  ────────────────────────────────────────────────────────────────────────────
  2713. SearchNext                        Repeats the Find command.
  2714.  
  2715.  SetBookMark0                      Sets bookmark 0. You may later return to
  2716.                                    this position with GotoBookMark0.
  2717.  
  2718.  SetBookMark1                      Sets bookmark 1.
  2719.  
  2720.  SetBookMark2                      Sets bookmark 2.
  2721.  
  2722.  SetBookMark3                      Sets bookmark 3.
  2723.  
  2724.  
  2725.  
  2726.  Table   A.2 (continued)
  2727.  
  2728. ╓┌─────────────────────────────────┌─────────────────────────────────────────╖
  2729.  Function                          Description
  2730.  ────────────────────────────────────────────────────────────────────────────
  2731.  SplitLine                         Splits a line in two (like NewLine), but
  2732.  Function                          Description
  2733.  ────────────────────────────────────────────────────────────────────────────
  2734.  SplitLine                         Splits a line in two (like NewLine), but
  2735.                                    leaves the cursor at the end of the
  2736.                                    first line instead of the beginning of
  2737.                                    the second.
  2738.  
  2739.  ToggleInsertMode                  Toggles between insert mode and overtype
  2740.                                    mode.
  2741.  
  2742.  Undo                              Cancels any commands that might have
  2743.                                    been performed on the current line. Undo
  2744.                                    works only when the cursor remains on
  2745.                                    the line being edited.
  2746.  
  2747.  WordLeft                          Moves the cursor to the previous word.
  2748.  
  2749.  WordRight                         Moves the cursor to the next word.
  2750.  
  2751.  ────────────────────────────────────────────────────────────────────────────
  2752.  
  2753.  Function                          Description
  2754.  ────────────────────────────────────────────────────────────────────────────
  2755. 
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  Appendix B  QuickC Differences
  2764.  ────────────────────────────────────────────────────────────────────────────
  2765.  
  2766.  The QuickC Compiler version 2.5 incorporates a variety of new features. If
  2767.  you've used version 1.0, you'll find many new features were added to version
  2768.  2.0, in addition to those added in the current 2.5 release.
  2769.  
  2770.  This appendix summarizes some of the significant differences between QuickC
  2771.  versions 1.0 and 2.0, and offers a comprehensive guide to the changes found
  2772.  in version 2.5. For detailed information about a feature, consult the online
  2773.  help, C for Yourself, or Microsoft QuickC Tool Kit.
  2774.  
  2775.  
  2776.  QuickC Version 2.0 Additions
  2777.  
  2778.  Additions to version 2.0 include
  2779.  
  2780.  
  2781.    ■   Expanded and improved online help system invoked by pressing F1
  2782.  
  2783.    ■   New presentation and real-coordinates graphics functions
  2784.  
  2785.    ■   Small, medium, compact, large, and huge memory models
  2786.  
  2787.    ■   Support of in-line assembly-language routines
  2788.  
  2789.    ■   New Local Variables, Notepad, and Registers windows
  2790.  
  2791.    ■   Text cut and paste support
  2792.  
  2793.    ■   Command line compiling and linking with QC.EXE and QCL.EXE
  2794.  
  2795.    ■   Incremental compilation
  2796.  
  2797.    ■   MKKEY utility for customizing editor key commands
  2798.  
  2799.  
  2800.  
  2801.  QuickC Version 2.5 Additions and Changes
  2802.  
  2803.  Additions and changes to version 2.5 affect both the QuickC environment and
  2804.  the C language implementation. The following sections list those changes.
  2805.  
  2806.  
  2807.  Interface and Environment Changes
  2808.  
  2809.  This section describes changes to the QuickC user interface and programming
  2810.  environment.
  2811.  
  2812.  
  2813.    ■   The Go To command in the Search menu moves to a specified line number
  2814.        in the source.
  2815.  
  2816.    ■   The Quickwatch command in the Debug menu gives faster access in
  2817.        viewing variables and expressions.
  2818.  
  2819.    ■   The Color command in the Options menu allows you to select four
  2820.        different sets of colors and to change the color of items such as
  2821.        menus, borders, and buttons.
  2822.  
  2823.    ■   Tabs can now be treated as spaces or actual tab characters.
  2824.  
  2825.  
  2826.  
  2827.  Language and Compiler Changes
  2828.  
  2829.  This section describes changes to the QuickC implementation of the C
  2830.  language and changes in the compiler's behavior.
  2831.  
  2832.  
  2833.  Memory Models
  2834.  
  2835.  
  2836.    ■   QuickC 2.5 now supports the tiny memory model, which produces .COM
  2837.        rather than .EXE files. In the tiny memory model, all of your
  2838.        program's code and data must fit in a single 64K segment.
  2839.        Additionally, tiny programs do not support graphics.
  2840.  
  2841.    ■   QuickC 2.5 supports custom memory models, such as huge-compact, with
  2842.        the /A compiler option. Refer to Microsoft QuickC Tool Kit for
  2843.        additional information.
  2844.  
  2845.  
  2846.  
  2847.  Constants
  2848.  
  2849.  
  2850.    ■   Both long and unsigned long values are allowed in switch expressions
  2851.        and case constants. Previous versions of QuickC allow only char and
  2852.        int values in this context.
  2853.  
  2854.    ■   QuickC supports unsigned long decimal constants. It is now possible to
  2855.        initialize unsigned long variables with values larger than MAX_LONG
  2856.        using decimal (rather than hexadecimal or octal) constants.
  2857.  
  2858.    ■   The constant NULL is now defined as  ((void *)0). Previous versions of
  2859.        QuickC defined NULL as 0x0000 in small and medium models and
  2860.        0x00000000L in compact and large models.
  2861.  
  2862.  
  2863.  
  2864.  Keywords
  2865.  
  2866.  
  2867.    ■   Storage classes or types (or both) are now required on variable
  2868.        declarations. QuickC previously assumed that untyped variables (such
  2869.        as  a;) were integers. This declaration now generates a warning.
  2870.  
  2871.    ■   The volatile keyword, which was previously implemented only
  2872.        syntactically, is now also implemented semantically.
  2873.  
  2874.    ■   To identify implementation-defined keywords as non-ANSI, an underscore
  2875.        has been added. Thus, far, near, huge, cdecl, fortran, interrupt, and
  2876.        pascal have been changed to _far, _near, _huge, _cdecl, _fortran,
  2877.        _interrupt, and _pascal. QuickC still accepts the obsolescent versions
  2878.        of these keywords, unless you use the /Za (disable extensions) option.
  2879.  
  2880.    ■   A new pseudo-instruction, _emit, has been added for use with the
  2881.        in-line assembler. It allows you to define a single immediate byte at
  2882.        the current location in the current text segment.
  2883.  
  2884.    ■   The const and volatile qualifiers must be placed after the name of the
  2885.        type they qualify. Consult online help for more information about
  2886.        const and volatile.
  2887.  
  2888.    ■   The new _fastcall function attribute causes QuickC to pass function
  2889.        arguments in processor registers instead of on the stack. This results
  2890.        in faster functions when a QuickC program is built with Microsoft C
  2891.        version 6.0.
  2892.  
  2893.  
  2894.  
  2895.  Locale-Specific Information
  2896.  
  2897.  
  2898.    ■   The LOCALE.H header file is new to version 2.5. It declares functions
  2899.        and structures for describing conventions, such as the currency
  2900.        symbol, that vary from one country to the next.
  2901.  
  2902.  
  2903.  
  2904.  Based Objects
  2905.  
  2906.  
  2907.    ■   QuickC 2.5 supports the following new keywords and operators, which
  2908.        are used to declare and manipulate based objects: _based, _segment,
  2909.        _segname, and :> (the based operator). Based object support is
  2910.        included in QuickC 2.5 for the sake of compatibility with Microsoft C
  2911.        version 6.0. Please refer to Chapter 2, "Managing Memory," in the
  2912.        Microsoft C Professional Development System Advanced Programming
  2913.        Techniques guide for further details.
  2914.  
  2915.  
  2916.  
  2917.  Data Types
  2918.  
  2919.  
  2920.    ■   QuickC version 2.0 recognizes long double and double as different
  2921.        types, with both types stored in memory as 64-bit quantities.
  2922.  
  2923.        Because the 80x87 family of math coprocessors supports an 80-bit
  2924.        floating-point type, QuickC version 2.5 stores long double variables
  2925.        in the 80x87 10-byte (80-bit) form.
  2926.  
  2927.        Certain library functions have been modified to handle the long double
  2928.        type. The printf and scanf family of functions supports long double
  2929.        values identified by a trailing l in the format specifier. The library
  2930.        contains new versions of the transcendental functions as well as
  2931.        intrinsic forms that accept long double arguments. These are
  2932.        identified by a trailing l in the function name (e.g., cosl).
  2933.  
  2934.    ■   Integer promotion rules have changed. Earlier versions of QuickC
  2935.        attempted to preserve an expression's unsigned nature as much as
  2936.        possible. Version 2.5 attempts to preserve the expression's value.
  2937.  
  2938.        In version 2.0, an unsigned char promotes to an unsigned int; an
  2939.        unsigned int promotes to an unsigned long.
  2940.  
  2941.        In version 2.5, an unsigned char promotes to a signed int; an unsigned
  2942.        int promotes to a signed long.
  2943.  
  2944.    ■   Shift operators now give a result that is of the same type as the left
  2945.        operand. QuickC previously yielded a result that was of the same type
  2946.        as the largest of the two values.
  2947.  
  2948.  
  2949.  
  2950.  Preprocessor
  2951.  
  2952.  
  2953.    ■   QuickC 2.5 allows longer macro expansions (up to 12K). In low memory
  2954.        conditions, the macro expansion space may be limited to 6K.
  2955.  
  2956.    ■   The data_seg pragma has been deleted.
  2957.  
  2958.    ■   Version 2.0 of QuickC treated conditional compilation expressions as
  2959.        signed long values. Version 2.5 evaluates these expressions using the
  2960.        same rules as are used for all other expressions in C.
  2961.  
  2962.  
  2963.  
  2964.  Structures, Unions, Arrays, and Bit Fields
  2965.  
  2966.  
  2967.    ■   If a structure or union is nested inside another structure or union,
  2968.        you can declare it without using a variable name. This rule simplifies
  2969.        references to inner members of such nested constructs.
  2970.  
  2971.    ■   QuickC now allows an unsized or zero-sized array as the last member of
  2972.        a structure. Unsized arrays can appear only as the last member of a
  2973.        structure. Structures containing unsized array declarations can be
  2974.        nested within other structures as long as no element of the enclosing
  2975.        structure follows the unsized array. Arrays of such structures are not
  2976.        allowed.
  2977.  
  2978.    ■   QuickC now allows longer string literals (up to 2K).
  2979.  
  2980.    ■   You may declare signed as well as unsigned bit fields.
  2981.  
  2982.    ■   Bit fields are permitted in unions.
  2983.  
  2984.  
  2985.  
  2986.  Memory Management
  2987.  
  2988.  
  2989.    ■   The memory-management routine sbrk has been deleted.
  2990.  
  2991.    ■   The _fmalloc function attempts to allocate far memory. In previous
  2992.        versions of QuickC, _fmalloc called _nmalloc if far memory was not
  2993.        available. Now it returns a null pointer if far memory isn't
  2994.        available, even if near memory is available.
  2995.  
  2996.    ■   Previous versions of QuickC placed the command-line argument strings
  2997.        and environment strings in the near heap. Now they are allocated
  2998.        through malloc. Because malloc maps to _fmalloc in the compact and
  2999.        large memory models, environment strings and command-line argument
  3000.        strings are in far memory in those memory models.
  3001.  
  3002.  
  3003.  
  3004.  Miscellaneous
  3005.  
  3006.  
  3007.    ■   QuickC supports a new warning level (4), which provides even more
  3008.        stringent error checking than the warning levels in version 2.0. You
  3009.        can set this warning level from the command line, by supplying the /W4
  3010.        compiler option, or from the QuickC environment, with the Compiler
  3011.        Flags button shown with the Make command in the Options menu. At
  3012.        warning level 4, QuickC generates warnings for nonportable (non-ANSI)
  3013.        constructs and for undefined or implementation-defined constructs.
  3014.  
  3015.    ■   The printf and scanf format specifier modifiers N, F, h, and l have
  3016.        changed. Consult online help for additional information.
  3017.  
  3018.    ■   In QuickC 2.0, a prototype or definition that returns a float value
  3019.        actually returns a double value. Version 2.5 interprets such a
  3020.        function as returning a float value.
  3021.  
  3022.    ■   QuickC version 2.5 does not align a char variable to an even address
  3023.        unless the variable is local. Likewise, a literal constant string is
  3024.        not aligned as in QuickC 2.0.
  3025.  
  3026.    ■   To maintain ANSI compatibility and portability between QuickC and
  3027.        other systems, QuickC now supports trigraphs such as  ??=  equivalent
  3028.        to  #.
  3029.  
  3030.