{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Essence%2BOf%2BC - THE ESSENCE OF C A Summary of the C...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
THE ESSENCE OF C A Summary of the C Language Compiled by K. J. Bricknell
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1 OVERVIEW Origins and Nature of C, Libraries, Linking, Compilation, Memory Map, Language Fundamentals, Keywords Origins of C C was developed at the Bell Laboratories in the early 70s by UNIX pioneer Dennis Ritchie and was first implemented on a DEC PDP-11 using the UNIX operating system. C, like all the structured languages (Pascal, PL/I, etc) can trace its ancestry back to ALGOL. For many years, the de-facto standard for C was the version supplied with UNIX Version 5, as described by Kernighan and Ritchie . To achieve standardisation, ANSI established a committee in 1983 to define the C language once and for all. Given this lineage, most current literature on the language covers both the old UNIX version of C and the ANSI standard . The Nature of C C is considered to be a middle level language because it combines elements of high-level languages with the functionalism of assembly language. Because it allows the direct manipulation of bits, bytes, words and pointers, it is well suited to system-level programming. C is a structured language in that it has the ability to section off and "hide" from the rest of the program all information and instructions required to perform a specific task. C is a primitive language in that it has none of the built-in features for input and output, string manipulation and higher mathematics found in other languages. C’s features come in function libraries. C is a compiled language . C compilers read the source code and convert it to object code , sometimes referred to as binary or machine code . Libraries and Linking C compilers come with a standard C library of functions. These functions perform commonly needed tasks. ANSI specifies a minimal set of functions; however, most compilers provide many others. When a function which is not part of the C program is called, the compiler "remembers" its name. Later, the linker combines your code with the object code in the standard library. Some functions defined in the original UNIX version of C are not defined in ANSI because they are redundant. Essence of C 1
Background image of page 2
Functions written by the programmer may also be placed in a library. Separate Compilation C allows a program to be contained in separate files, which are compiled separately before being linked. The advantage of separate compilation is that, if the programmer changes the code in one file, he does not need to recompile the whole program. This saves time. C's Memory Map A compiled C program creates and uses four logically distinct regions of memory, viz: Program code. Global variables. The stack , which holds the return addresses of function calls, arguments to functions and local variables, and saves the current state of the CPU.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}