home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / GENCTXT.ZIP / INTRO.TXT < prev    next >
Text File  |  1987-11-21  |  6KB  |  125 lines

  1.  
  2.                       Introduction to the 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 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.
  81.  
  82.              Throughout this tutorial, every attempt will be made to
  83.         indicate  to  you what constructs are available in  every  C
  84.         compiler  because they are part of the accepted standard  of
  85.         programming practice.
  86.  
  87.              Modern C compilers are very capable systems, but due to
  88.         the tremendous versatility of a C compiler, it could be very
  89.         difficult  for you to learn how to use it  effectively.   If
  90.         you are a complete novice to programming, you will  probably
  91.         find the installation instructions somewhat confusing.   The
  92.         file on the SOURCE disk named COMPILER.DOC is provided as an
  93.         aid  since it describes some of the more  popular  compilers
  94.         with notes on how to use them.  You should print out a  copy
  95.         of  COMPILER.DOC  at  this  time and use it  as  an  aid  to
  96.         installing your C compiler on your system.
  97.  
  98.              This  tutorial cannot cover all aspects of  programming
  99.         in C, simply because there is too much to cover, but it will
  100.         instruct  you  in  all you need for  the  majority  of  your
  101.         programming  in C.  You will receive instruction in  all  of
  102.         the  programming constructs in C, but what must  be  omitted
  103.         are  methods of programming since these can only be  learned
  104.         by  experience.   More importantly, it will  teach  you  the
  105.         vocabulary  of C so that you can go on to the more  advanced
  106.         techniques of using the programming language C.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.                                   Page 2
  125.