Brief History
Kenneth Thompson created the B language in 1969-70; it was derived directly from Martin Richards' BCPL. Dennis Ritchie turned B into C during 1971-73, keeping most of B's syntax while adding types and making many other changes. It was also the first compiler. Ritchie, Alan Snyder, Steven C. Johnson, Michael Lesk, and Thompson contributed language ideas during 1972-1977, and Johnson's portable compiler remains widely used.
The C programming language was devised to implement the new UNIX operating system, which was an innovation in the field of computers by then. C has become one of the dominant languages of today.

What is C?
C is a mid-level structured programming language. It is low-level enough to allow the programmer to take complete control over program execution, meaning you can do pretty much whatever you want. It is also high-level enough to make some tasks easier, such as loops, conditionals and function calls. C does not stand for any abbreviation. The name comes as an evolution of the B language which is based on BCPL language. There are C compilers for practically every platform, from Intel to Alpha and Sparc, from DOS to Windows, BSD, Linux, Macintosh, UNIX, VMS, Solaris, BeOS. It is not the most portable language, but it can very powerful in the hands of the right programmer.

What Can C Be Used For?
C is used for a variety of tasks. The two biggest are operating systems and scientific applications. Most operating systems have at least some C in them, although some mix in assembly language and C++. Linux, for example, is mostly C except for the low-level parts that use assembly. Scientific applications are mainly developed using C under UNIX or Linux environments. Games are often written in C, although more and more they are being written in C++.

C can be used to do just about anything. Some tasks require more work than others, which is why people are using C++ more and more for projects that used to be done in C. It is good to know both languages, however. Old projects may be in C and too difficult to translate to C++, or not worth the time. In that case it is important to know C for maintenance purposes. Knowing C also provides a good foundation to learn C++. There are some things the C++ standard library does not do but the C library does. Rather than reinventing the wheel, it makes sense to use both C and C++ libraries and ideas next to each other.

What Is The Syntax Like?
C programs start with headers. They usually contain data definitions: for example, program constants, macros, prototypes, global variables, etc. but not actual logic. The main block in a C program is the main() function which is a system function including the logic flow of the C program. Inside the main(), all the local variables are first declared. Next comes the function calls and all the logic of the program.

C programs usually have several pieces that fit together to make a program. Usually you will have a group of source code files that are compiled separately, then linked together into a single executable file. Each source code file will have a header file that describes its contents.

Your source code files contain all your code that actually does stuff, the program logic. Multiple files are used for all but the shortest of programs because it just isn't practical to have a single source code file with thousands or even millions of lines of code. It's too difficult to maintain. Usually, similar functions are grouped together in a single file. For example, one file may contain your program's code for loading and saving its data to disk. Another file may contain the code for displaying the main window. The header files usually contain little or no program logic.

Functions are the cornerstone of C programming. Functions are cohesive blocks of code that perform common tasks. Code reuse is an important programming concept, and functions allow you, the programmer, to achieve this. Rather than typing out the same task a thousand times, you can put it in a function and use that function over and over again. Therefore, program size becomes smaller.

Another Facts is that C uses pointers extensively. It uses them freely than any other Programming Language. Pointers are variables which store the address of other variables. Using pointers U can literaly point to any addressing location of your system.

An Example C Program
This is an example of a C program.
/* Include the Standard C functions for input and output */
  1. include <stdio.h>
/* This is the main function, where the program starts running */ int main (void) { /* Display a short message to the user */ printf ("I charge thee. Speak! \n"); /* Program is done now, return to the operating system */ return 0; }


An Example C Program to give idea obout pointers.
This is an example of a C program.
/* Include the Standard C functions for input and output */
  1. include <stdio.h>
/* This is the main function, where the program starts running */ void main() { /* Declare variable of integer type and a pointer variable and initialise the variable with the value of 10*/ int var=10,*vptr; /* Initialise the pointer with address of variable*/ vptr=&var; /* Display the containt of each variable */ printf ("%d",var); printf ("%u",&var); printf ("%u",vptr); printf ("%d",*vptr); }


What Do I Need To Get Started?
You will need a C compiler. This is available for free with any UNIX-based operating system including Linux. You can download Borland C++ Builder (if you are using Windows) or GNU C++ Compiler (gcc) (if you are using Linux). These compilers can be used for both C and C++.

Are There Any C Tools I Can Buy?
You can buy a whole range of C development tools for Windows from Borland.

What Does Programmers Heaven Offer Me?
Visit the C Section of the site to see articles on C as well as source code, development tools and links to many sites, including tutorials pitched at many different levels. If you need assistance, why not post your question on our friendly and lively C message board?
 

Other Views

corner

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.