home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / trboctxt.arc / INTRO.TXT < prev    next >
Text File  |  1988-02-01  |  7KB  |  191 lines

  1.  
  2.                    Introduction to the Turbo C Tutorial
  3.  
  4.  
  5.              The programming language C, was originally developed by
  6.         Dennis  Ritchie of Bell Laboratories and was designed to run
  7.         on a PDP-11 with a UNIX operating system.   Although it  was
  8.         originally  intended  to run under UNIX,  there has  been  a
  9.         great  interest  in  running it under the  MS-DOS  operating
  10.         system and specifically on the IBM PC and  compatibles.   It
  11.         is an excellent language for this environment because of the
  12.         simplicity of expression,  the compactness of the code,  and
  13.         the wide range of applicability.
  14.  
  15.              It  is  not a good "beginning" language because  it  is
  16.         somewhat cryptic in nature.  It allows the programmer a wide
  17.         range of operations from high level down to a very low level
  18.         approaching the level of assembly language.   There seems to
  19.         be no limit to the flexibility available.  One experienced C
  20.         programmer made the statement,  "You can program anything in
  21.         C", and the statement is well supported by my own experience
  22.         with  the  language.    Along  with  the  resulting  freedom
  23.         however,  you take on a great deal of responsibility because
  24.         it is very easy to write a program that destroys itself  due
  25.         to  the  silly little errors that the Pascal  compiler  will
  26.         flag  and call a fatal error.   In C,  you are very much  on
  27.         your own as you will soon find.
  28.  
  29.              Since C is not a beginners language,  I will assume you
  30.         are  not a beginning programmer,  and I will not attempt  to
  31.         bore you by defining a constant and a variable.  You will be
  32.         expected to know these basic concepts.   You will,  however,
  33.         be  expected to know nothing of the C programming  language.
  34.         I  will begin with the most basic concepts of C and take you
  35.         up  to  the  highest level of C  programming  including  the
  36.         usually intimidating concepts of pointers,  structures,  and
  37.         dynamic allocation.   To fully understand these concepts, it
  38.         will  take a good bit of time and work on your part  because
  39.         they  not  particularly easy to grasp,  but  they  are  very
  40.         powerful tools.   Enough said about that, you will see their
  41.         power when we get there,  just don't allow yourself to worry
  42.         about them yet.
  43.  
  44.              Programming  in C is a tremendous asset in those  areas
  45.         where you may want to use Assembly Language but would rather
  46.         keep it a "simple to write" and "easy to maintain"  program.
  47.         It  has  been said that a program written in C  will  pay  a
  48.         premium  of  a  50 to 100% increase in  runtime  because  no
  49.         language  is  as  compact  or  fast  as  Assembly  Language.
  50.         However, the time saved in coding can be tremendous,  making
  51.         it the most desirable language for many programming  chores.
  52.         In  addition, since most programs spend 90 percent of  their
  53.         operating time in only 10 percent or less of the code, it is
  54.         possible  to  write  a program in C, then  rewrite  a  small
  55.         portion  of the code in Assembly Language and  approach  the
  56.  
  57.  
  58.                                   Page 1
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                    Introduction to the Turbo C Tutorial
  69.  
  70.  
  71.         execution  speed  of  the same program if  it  were  written
  72.         entirely in Assembly Language.
  73.  
  74.              Even  though the C language enjoys a good  record  when
  75.         programs are transported from one implementation to another,
  76.         there  are differences in compilers as you will find anytime
  77.         you  try to use another compiler.   Most of the  differences
  78.         become apparent when you use nonstandard extensions such  as
  79.         calls  to  the DOS BIOS,  but even these differences can  be
  80.         minimized  by careful choice of programming means.  Turbo  C
  81.         follows  the  developing  ANSI standard so  well  that  your
  82.         programs  developed with Turbo C should be very portable  if
  83.         you should decide to use a different ANSI standard compiler.
  84.  
  85.              Throughout this tutorial, every attempt will be made to
  86.         indicate  to  you what constructs are available in  every  C
  87.         compiler  because they are part of the accepted standard  of
  88.         programming practice.  Most of those constructs will use the
  89.         generic  name "C", such as in the statement, "writing  to  a
  90.         file is easy in C after you master a few fundamentals."   If
  91.         a  particular  construct  is  a  Borland  extension  to  the
  92.         language, it will be pointed out as such as an indication to
  93.         you that it may not be available on other compilers.
  94.  
  95.              Turbo  C  is a very capable compiler, but  due  to  the
  96.         tremendous  versatility of this compiler, it could  be  very
  97.         difficult  for you to learn how to use it  effectively.   If
  98.         you are a complete novice to programming, you will  probably
  99.         find the installation instructions somewhat confusing.   The
  100.         file on the SOURCE disk named COMPILER.DOC is provided  just
  101.         for  you  since it will take you step by  step  through  the
  102.         installation procedure and even show you how to compile  and
  103.         run  your  first program.  You should print out  a  copy  of
  104.         COMPILER.DOC at this time and use it as an aid to installing
  105.         Turbo C on your system.
  106.  
  107.              This  tutorial cannot cover all aspects of  programming
  108.         in C, simply because there is too much to cover, but it will
  109.         instruct  you  in  all you need for  the  majority  of  your
  110.         programming  in C.  You will receive instruction in  all  of
  111.         the  programming constructs in C, but what must  be  omitted
  112.         are  methods of programming since these can only be  learned
  113.         by  experience.   More importantly, it will  teach  you  the
  114.         vocabulary  of C so that you can go on to the more  advanced
  115.         techniques of using the programming language C.
  116.  
  117.              It  would definitely be to your advantage to study  the
  118.         Turbo C User's Guide at this point to gain experience in how
  119.         to  edit,  compile, and run a C program.   You  should  read
  120.         chapter  2  to  familiarize  yourself  with  the  Integrated
  121.         Environment and learn how to use it, and to learn how to use
  122.  
  123.  
  124.                                   Page 2
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                    Introduction to the Turbo C Tutorial
  135.  
  136.  
  137.         the  full  screen  editor which is a part  of  the  Turbo  C
  138.         Integrated Environment.
  139.  
  140.              Remember  to read the file COMPILER.DOC To aid  you  in
  141.         compiling your first program.
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.                                   Page 3
  191.