The C programming language pdf

Introduction

The C programming language was originally developed by Dennis Ritchie of Bell Laboratories,and was designed to run on a PDP-11 with a UNIXoperating system. Although it was originally intended to run under UNIX, there was a great interest in running it on the IBM PC and com-patibles, and other systems. C is excellent for actually writing system level programs, and the entire Applix 1616/OS operating system is written in C (except for a few assembler routines).It is an excellent language for this environment because of the simplicity of expression, the compactness of the code, and the wide range of applicability.It is not a good « beginning » language because it is somewhat cryptic in nature. It allows the programmer a wide range of operations from high level down to a very low level approaching the level of assembly language. There seems to be no limit to the flexibility available. One experienced C programmer made the statement, « You can program anything in C », and the statement is well supported by my own experience with the language. Along with the resulting freedom however, you take on a great deal of responsibility. It is very easy to write a program that destroys itself due to the silly little errors that, say, a Pascal compiler will flag and call a fatal error.

1-Getting Started
This tutorial can be read simply as a text, however it is intended to be interactive. That is, you should be compiling, modifying and using the programs that are presented herein. All the programs have been tested using the HiTech C compiler, and we assume that you have a copy of this. In addition, you should have a copy of various updates and header files for the C compiler, which appear on Applix User disks.You can use either the builtin Applix 1616/OS editoredit, or the $30 Dr Doceditor innon-document mode.Dr Docis somewhat more powerful, however as it loads from disk, it is slightly slower to get started. The source code has been edited to suit a tab setting of 5, so invoke your editor with tabs set to a spacing of 5. For example,edit sourcecode.c 5would let you edit a file calledsourcecode.c.
Before you can really use C, there are certain equipment requirements that must be met. You must have a disk co-processor card, and at least one disk drive. If your drives are smaller than 800k, you will probably require two disk drives. We assume you either have 1616/OS Version 4 multitasking, or else have anassignMRD available on your boot disk.You should make use of thexpath, and theassigncommands to set up your boot disk in a form suitable for use with C. This should be done in theautoexec.shellfile on your boot disk, as set out below.
1.1 C Boot Disk
Make a new, bootable copy of your 1616 User disk, following the directions in yourUsers Manual. To ensure sufficient space, delete any obviously unwanted files you notice on the copy.Copy the contents of your HiTech C distribution disk to the new disk, keeping the subdirectories the same as on the HiTech disk.If you have received any updated C header files or other updates, copy these also to their respective subdirectories on your new disk.Usingedit, alter thexpathandassigncommands in yourautoexec.shellfile in the root directory of your new disk.
Yourxpathshould include/F0/bin(if it is not already included).
Add the following lines to yourautoexec.shell, to recreate the environment used by Tim Ward when originally running these programs.
assign /hitech /f0/bin
assign /sys /f0/include
assign /temp /rd
This will allow code to be written without regard to where you actually put your files. If you are using a second drive, or a hard disk, simply change the assign to point/hitechto the correct drive. C tends to use temporary files extensively. If you have sufficient memory available on your ram disk, use/rdfor temporary files. If not, use the current drive and directory, as indicated by theassign /temp.
Make sure you copy the new C preprocessorrelcc.xrelfrom the user disk into the/bin subdirectory of your new C disk..

Si le lien ne fonctionne pas correctement, veuillez nous contacter (mentionner le lien dans votre message)
Language C tutorial (418 KO) (Cours PDF)
Language C tutorial

Télécharger aussi :

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *