COMPLETE C PROGRAMMING (Fom file handling through graphics to bios to hardware)

Submitted on: 1/6/2015 1:55:00 AM
By: stephen antony (from psc cd)  
Level: Beginner
User Rating: By 9 Users
Compatibility: C
Views: 1613

This article has accompanying files
				C The worlds most popular language is still the toppest 
language when it comes to serious programming whether in web based(cgi) or in 
case of stand alone client applications or operating systems only a detailed 
understanding of c will help us to know the reason of the success of this 
language so lets go through it
The 'C' language was developed at the AT&T Bell Laboratories, USA by Dennis Ritchie in 1972 on a DEC PDP-II machine. This language is derived from an another language called B developed by Ken Thompson of Bell Laboratories in 1970 which is devCGeloped from the language BCPL (Basic Combined Programming Language) developed by Martin Richard of Cambridge University in 1967 which is derived from the language CPL (Combined Programming Language) developed by Cambridge University and the University of London in 1963 and it is developed from the lan-guage called ALGOL (Algorithmic Language) developed by an International Commit-tee in the year 1960.
The 'C' Language was originally developed for programming under UNIX Operating system, which was developed by Ken Thompson and Dennis Ritchie. After develop-ing 'C' almost 90% of UNIX operating system is rewritten in C from assembly lan-guage. Therefore UNIX and C have a close relationship.
'C' gives the programmer what he wants, i.e., few restrictions, block structures, standard functions, a compact set of keywords and rich set of data structures.
For many years 'C' has no standard. i.e. Every manufacture developed their style of 'C' compilers. In 1983 the American National Standards Institute (ANSI) established a committee named X3J11 created a standard for the 'C' language. The standard includes the character-set, keywords, compiler environment and the function library etc.
C is a structured language, which uses the compartmentalisation; i.e. A program is broken into different modules, each of which is used for a single specific task. This is supported in 'C' by the use of functions. Basically a 'C' program is a collection of one or more functions.
'C' language also supports the programming structures like sequence, selection and iteration/looping. However the goto statements are not encouraged in structured programming, 'C' supports it too.
Even though 'C' is a high level language it is often called a middle-level language because it combines the elements of high level language, like structured program-ming, modular programming etc. with the functionalism of the assembly language like direct manipulation of bits, bytes, memory addressees with the help of pointers.
'C' is a flexible, general-purpose language. i.e. The capability of manipulating bits, bytes, memory address makes it well suited for systems programming and the high-level components makes it suitable for application packages. 'C' is used for writing operating systems like UNIX and MS-DOS and the compilers and interpreters for BASIC, FORTRAN, Pascal, LISP, LOGO etc. Popular application packages like dBase, Lotus 1-2-3 and CLIPPER are also written in 'C'.
'C' language is machine independent and it is a highly portable language. Portable means that 'C' programs written for one computer/operating system can be run on another with little or no modification. All high-level languages are portable. 'C' is considered to be highly portable because the machine dependent parts in 'C' com-pilers are written in 'C'.
Turbo C compiler is an integrated package. It includes an editor, compiler, linker and loader. Every 'C' program file is identified using the ‘.C’ extension. The source code written using the editor is first passed through the C pre-processor. The pre-processor is a program that modifies the source code according to directives sup-plied in the program. The Pre-processor Directives begin with the # symbol. They must start in the first column and they are usually placed at the beginning of a pro-gram. The pre-processor expands the directives and it’s output, the expanded source code is fed to the 'C' compiler. The compiler translates the source code into the assembly language. The system assembler produces the object code (.obj). This object code has to be linked with support routines from the 'C' run-time library to obtain the final executable code (.exe). The systems loader can run the executable code.
'C' Language has no input/output operations. The compiler compiles a language of functions, all input and output is done with functions. Because of this feature, a standard library gives 'C' its most endearing feature is portability.
Every function must be defined before it can be used in the program. Every function definition has two parts, a function header and a body that follows it. The header defines the function’s name and the arguments. The headers of the library functions are stored in header files with extension .h. So these must be included before the library functions are used in a 'C' program.
Using the Turbo C Compiler
Type tc at the DOS prompt and press ENTER key. The Turbo C integrated environ-ment displays on the screen. You can use the menu options like save, open, create a new file etc. from the main menu strip which is at the top most line of the screen.
After typing the program you can save it by pressing the F2 key or File?Save com-mand. If necessary give the filename. To execute the program press Ctrl+F9 key combination. The progress window on the screen will show each phase in the crea-tion of the executable file. If there are no errors, the screen will be cleared and the program will start running. After the program is executed, you will get back to the Turbo C environment automatically. You can view the user screen by pressing the Alt+F5 key combination. To return to the Turbo C environment strike any key.
If there are any errors in the program, the messages along with the line numbers will be displayed in a separate message window at the bottom of the screen. Pressing the F6 key can make corrections, which place the cursor in the Edit window. After making corrections save it again and run.
You can activate the main menu by pressing the F10 key and then use the arrow keys. You can quit the Turbo C integrated environment by pressing Alt+X key com-bination.

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net

Other 2 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.