The History of the C Language in depth.

The History of C Language


  • The C programming language was invented by Bell Labs (AT&T) employee Dennis M. Ritchie in the early 1970s.
  • In the 1960s Ritchie worked on a project called Multics, along with several other staff of Bell Labs (AT&T). The project's aim was to create a large-computer operating system that could be used by a thousand people.
  • AT&T (Bell Labs) withdrew from the project in 1969, because the project was not able to produce an economically useful device. But Bell Labs staff (AT&T) had to look for another project (mainly Dennis M. Ritchie and Ken Thompson) to be working on.
  • Ken Thompson has begun working on developing a new file system. He wrote, in assembler, a version of the new DEC PDP-7 filesystem (The new file system used for Space Travel game as well). 
  • They soon began making improvements and introducing extensions. (They used there knowledge from the Multics project to add improvements).
  • After a while a complete system was born. Brian W. Kernighan called the system UNIX, a sarcastic reference to Multics. The whole system was still written in assembly code.
  • In addition to assembler and Fortran UNIX also had a programming language B interpreter. (Martin Richards BCPL derives the B language directly from that). Ken Thompson created language B in 1969–70.
  • In the early days computer code was written in assembly code. To perform a specific task, you had to write many pages of code. 
  • A high-level language like B made it possible to write the same task in just a few lines of code. 
  • The language B was used for further development of the UNIX system. Because of the high-level of the B language, code could be produced much faster, then in assembly.
  • A drawback of the B language was that it did not know data-types. (Everything was expressed in machine words). Another functionality that the B language did not provide was the use of “structures”. 
  • The lag of these things shaped Dennis M. Ritchie's justification for creating programming language C. So Dennis M. Ritchie converted the B language into the C language in 1971-73, retaining most of the B syntax but adding data-types and many other improvements.
  • The C language had a strong combination of flexibility at the highest level and the comprehensive features required to program an operating system. So many of UNIX elements were finally rewritten in C (in 1973 the Unix kernel itself was rewritten.
  • The programming language C was published in a now classic book entitled "The C Computer Language, 1st edition" by Kernighan and Ritchie. 
  • (Kernighan said he had no role in the creation of the C language:' This is entirely the work of Dennis Ritchie,' but he is the developer of the popular' Hello, World ' software and many other UNIX programs).
  • For years the standard on language C was the book "The C Programing Language, 1st edition." 
  • In 1983 the American National Standards Institute (ANSI) created a committee to create a modern definition of programming language C (ANSI X3J11).
  • They issued the final default description ANSI C in 1988. (The Standard was based on the K&R 1st ed. book).
  • The standard ANSI C made little changes on the original design of the C language. (They had to make sure that old programs still worked with the new standard). 
  • Later the International Organization for Standards (ISO) adopted the ANSI C standard. ISO C should be the right term beforehand, but everyone still calls it ANSI C.

MORE ABOUT

A Brief History of C

  • C is a general-purpose language that was closely linked to the UNIX operating system for which it was built-as the system and most of the programs running it are written in C.
  • Many of C's significant ideas come from the BCPL vocabulary developed by Martin Richards. 
  • For the first UNIX system on a DEC PDP-7, BCPL's effect on C continued indirectly by language B, which was written by Ken Thompson at Bell Labs in 1970. BCPL and B are "type less" languages while C provides various types of data.
  • In 1972 Dennis Ritchie writes C at Bell Labs and in 1978 Kernighan & Ritchie's release of The C Programming Language sparked a revolution in the computing world.
  • The American National Standards Institute (ANSI) set up a committee in 1983 to produce a new, standardized description of C. The resulting specification, the ANSI or "ANSI C" norm, was completed late in 1988.
  • In coding, C is a general-purpose programming language developed between 1969 and 1973 by Dennis Ritchie at AT&T Bell Labs (as in letter C).
  • Like most imperative languages in the ALGOL tradition, C has standardized programming facilities and allows for variety and recursion of lexical variable, while a static type system prevents several unintended operations.
  • The architecture offers constructs that correspond to standard machine instructions effectively, and has therefore found enduring use in applications that had previously been written in assembly language, most notably system software such as the Unix computer operating system.
  • C is one of the most widely used programming languages of all time, and C compilers are available for the majority of available computer architectures and operating systems.
  • Many later languages have borrowed directly or indirectly from C, including D, Go, Rust, Java, JavaScript, Limbo, LPC, C#,Objective-C, Perl, PHP, Python, Verilog (hardware description language),[4] and Unix's C shell. 
  • These languages have drawn many of their control structures and other basic features from C. 
  • Most of them (with Python being the most drastic exception) are also very syntactically similar to C in general, and appear to combine C's familiar expression and statement syntax with underlying type-systems, data structures, and radically different semantics.
  • C++ and Objective-C started as compilers that generated C code; C++ is nearly a superset of C, while Objective-C is a strict superset of C.
  • Before there was an official standard for C, many users and implementors relied on an informal specification contained in a book by Dennis Ritchie and Brian Kernighan; that version is generally referred to as "K&R" C. In 1989 the American National Standards Institute published a standard for C (generally called "ANSI C" or "C89"). 
  • The next year, the same specification was approved by the International Organization for Standardization as an international standard (generally called "C90"). 
  • ISO later released an extension to the internationalization support of the standard in 1995, and a revised standard (known as "C99") in 1999. The current version of the standard (now known as "C11") was approved in December 2011.

Compiler

  • A compiler is a program that translates one language (high level) into another language (e.g., assembly language or machine specific language). 
  • A compiler translates source code (plain text) into object code (normally in a form suitable for processing by other programs (like a linker)). 
  • The most common reason for wanting to translate source code is to create an executable program.
  • After the compiler translates the source code in object code, the object(‘s) have to be linked into an executable. 
  • This is done by a program called a linker (in most cases the compile stage and link stage are done automatically. 
  • It is also possible to do these stages separately).
  • There are many different compilers available. Some compilers are operating system specific other can be used on different platforms. 
  • In the following two sections we take a look at two compilers: GNU compiler and Visual Studio.

GNU Compiler

  • As well as libraries for these languages, the GNU Compiler Collection (GCC) contains front ends for C, C++, Objective-C, etc. GCC can be used on a variety of platforms, but is commonly used on Unix and Linux.
  • If you want to use GCC on a windows machine, check out Cygnus for a preview. A Linux partition can also be built separately from a Windows partition (multi boot system). For this we suggest using Ubuntu distribution.
  • You can use the text editor you prefer to write your programs in. You can use the following command to compile the program after writing your program:
  • G++ is also built on some computers, with the code c++. C++ programs can also be compiled with gcc, but the use of gcc does not include the C++ library. G++ is a program that calls GCC and handles files.c,.h, and.i as C++ source files instead of C source files when -x is used, and automatically defines a connection to the C++ library.

Visual Studio 2005/2008 (Express 

edition)

  • Visual studio is the developer studio from Microsoft. It provides a complete set of development tools to create windows programs in many different languages (like visual basic, visual c++, etc.). 
  • The complete developer studio is not free. But it is possible to download an express edition of Visual Studio C++ 2005 or 2008. (You have to register).
  • If you want to use Visual Studio Express to compile win32 (console) programs, then you also need to install the SDK module.
After you installed Visual Studio C++ and the platform SDK you can start your project. To set-up a win32 console application (in Visual Studio 2005) do the following:
  • File, New, Project
  • Project types : Visual C++, win32
  • Templates : Win32 Console Application
  • Give the project a name and press OK and then click next.
  • Check Console Application and Empty project by Application settings.
  • Click finish.
An empty project is now made. To add a new source file do the following:
  • In the solution explorer select Sources files and right click on it.
  • Add, New item, Templates: C++ file (.cpp), Name the file and press add.
  • File, Save all.
The last thing to do is to set some Project properties:
  • Project, Properties….
  • Select General
  • Set Character from “Use Unicode Character Set” to “Use Multi-Byte Character Set”.
  • Exit with OK.
You are now ready to program your first program. After writing your program you can compile it by pressing F7.

Important

  • All console programs are the examples found in the C and C++ tutorials. That means they communicate using email. All of the compilers allow console software compilation. Consult the compiler's user manual for more information on how to compile them. (We can not write down that for every compiler).

Variables And Constants

  • In this C programming language tutorial we take a look at variables and constants.

Variables

  • If you declare a variable in C (later on we talk about how to do this), you ask the operating system for a piece of memory. 
  • This piece of memory you give a name and you can store something in that piece of memory (for later use). There are two basic kinds of variables in C which are numeric and character.

Numeric variables

  • Numeric variables can either be of the type integer (int) or of the type real (float). Integer (int) values are whole numbers (like 10 or -10). Real (float) values can have a decimal point in them. (Like 1.23 or -20.123).

Character variables

  • Character variables are Alphabet letters, ASCII characters, or 0-9 numbers. If you declare a variable of characters you must always place the character between single quotes (like ' A '). So note that a number without single citations is not the same as a single quote character.

Constants

  • The contrast between variables and constants is that at any time variables can change their value, but constants can never change their value. (The value of the constants is locked during program duration). Constants can be very useful, Pi is a good example to announce as a constant, for example.

Data Types

  • So you now know that there are three types of variables: numeric – integer, numeric-real and character. A variable has a type-name, a type and a range (minimum / maximum). In the following table you can see the type-name, type and range:

Declaring
  • So now we know different type-names and variables classes, but how we define them. It is extremely easy to declare a variable. You must first declare the name of the type. You put the name of the variable after type-name.
  • The name of a variable can be anything you like as long it includes only letters, underscores or numbers (However you cannot start the name with a number). But remember choose the names wisely. 
  • It is easier if a variable name reflects the use of that variable. (For instance: if you name a float PI, you always know what it means).

Signed and unsigned variables

  • The difference between signed and unsigned variables is that signed variables can be either negative or positive but unsigned variables can only be positive. 
  • By using an unsigned variable you can increase the maximum positive range. 
  • When you declare a variable in the normal way it is automatically a signed variable. 
  • Just put the word unsigned before your variable declaration or signed for a signed variable to declare an unsigned variable, although there is no reason to declare a variable as already signed.

Calculations and variables

  • There are different operators that can be used for calculations which are listed in the following table:

Now that we know the different operators, let’s calculate something:
int main()
{
a=1;
int a, b;
a=a+1;
return 0;
}

Reading and printing

  • It's not really easy to measure something without reading feedback or writing something on the board. We will use the command scanf to read data from the keyboard. (What we all know about printing something on the screen).
So let’s make a program that can do all these things:
#include<stdio.h>
int main()
{
scanf("%d", &inputvalue);
int inputvalue;
printf("Ten times the input equals %d\n",inputvalue);
inputvalue = inputvalue * 10;
 return 0;

}
Note: The input must be a whole number (integer).
  • The & sign will be explained in a later tutorial. The %d is for reading or printing a decimal integer value (It is also possible to use %i). In the table below you can find the commands for other types:



Post a Comment

Previous Post Next Post