refined C_programming_language Information, explanation, recent texts, monographs, and related patents.
Information & explanations, latest texts & monographs on C_programming_language (including recent related patents.)


C programming language

C is a programming language developed by Ken Thompson and Dennis Ritchie, in the early 1970s, for use on the UNIX operating system. It is now used on practically every operating system, and is the most popular language for writing system software, though it is also used for writing applications. It is also commonly used in computer science education. The popular C++ programming language is based on, but is not a proper superset of C (while most well-formed C programs are well-formed C++ programs, not all are, e.g., this trivial example is a legal C, but not a legal C++, program int main( void ) { main() ; } (ISO/IEC 14882:1998, 3.6.1 [basic.start.main]) ) . Table of contents showTocToggle("show","hide") 1 Features 2 History 2.1 Early developments 2.2 K&R C 2.3 ANSI C and ISO C 2.4 C99 3 "Hello, World!" in C 4 Programming tools 5 See also 6 References 7 External links Features C is a relatively minimalist programming language and is more low-level than most others. It is often referred to as a low level language or "high level assembler". Even though it is sometimes referred to as a "high level language", it is only really higher-level than the various assembly languages. C has two important advantages over assembly. Firstly, code is generally easier to read and much less burdensome to write, especially for lengthy programs. Secondly, assembly code is usually applicable only to a specific computer architecture, whereas a C program can be ported to any architecture on which a C compiler and certain required libraries exist. (C code is almost always compiled, rather than interpreted.) On the other hand, the efficiency of C code is somewhat dependent on the ability of the compiler to optimize the resulting machine language, which is largely out of the programmer's control. In contrast, the efficiency of assembly code is precisely determined, since assembly is just human-readable notation for a machine language. For this reason, programs such as operating system kernels, though mostly written in C, may contain "hand-tuned" fragments of assembly language where performance is especially crucial. It should be noted, however, that for complex modern processors the assembly generated by C compilers is usually faster than hand-written assembly. In any event, the most powerful influence a programmer has on performance is through the choice of algorithms. Similar advantages and disadvantages distinguish C from higher-level languages: the efficiency of C code can be more closely controlled, at the cost of being generally more troublesome to read and write. Note, however, that C is at least as portable as higher-level languages, because nowadays most computer architectures are equipped with a C compiler and libraries; in fact, the compilers, libraries, and interpreters of higher-level languages are often implemented in C! Data storage in C is handled in 3 basic ways, by static memory allocation (essentially at compile time), by automatic allocation on the program stack, and by dynamic allocation through library calls from an area of memory called the heap. There is also a data type called a pointer that can hold a reference to a variable. A pointer is, roughly speaking, an abstraction of what assembly programmers call an index register. Pointers are a very useful and powerful programming tool. Pointers have been criticized because the simplicity of the implementation allows the introduction of malfunctions and vulnerabilities in C programs. The Java and C# languages, both descendants of C, use safer ways of referring to variables that make it much harder to write incorrect programs. These languages also have run-time systems that can detect most of the remaining problems. Run-time checking introduces overhead, but in almost all applications is worthwhile because of the greater guaranty of correct operation it provides. Pointer variables exist independently from the variables they refer to, leading to various wild pointer problems. Because the programmer is responsible for deallocation of dynamic memory, it is easy in C to produce the kind of problem known as a memory leak, where the heap size grows without limit. Languages that manage dynamic memory allocation help prevent this problem, but something like it is still possible because garbage collection can not occur while references to a dynamic allocation exist. Memory can be referenced in C by adding an integer to a pointer, called pointer arithmetic, but there is generally no check on whether the result is valid. Array elements in C are accessed using pointer arithmetic, so it is possible to refer to elements in an array that were never allocated. A language that uses run-time array bounds checking is protected from the buffer overflow vulnerabilities that result from allocating fixed size buffers on the stack. Tools have been created to help C programmers avoid memory errors, including libraries for performing array bounds checking and automatic garbage collection, but they are not a standard part of C. Automated source code checking and auditing is fruitful in any language, in C the best know tool is Lint. Some of the specific features of C are: History Early developments The initial development of C occurred at AT&T Bell Labs between 1969 and 1973; according to Ritchie, the most creative period occurred in 1972. It was named "C" because many of its features were derived from an earlier language called "B". Accounts differ regarding the origins of the name "B": Ken Thompson credits the BCPL programming language, but he had also created a language called Bon in honor of his wife Bonnie. By 1973, the C language had become powerful enough that most of the UNIX kernel, originally written in PDP-11/20 assembly language, was rewritten in C. This was one of the first operating system kernels implemented in a language other than assembly, earlier instances being the Multics system (written in PL/I) and TRIPOS (written in BCPL.) K&R C In 1978, Ritchie and Brian Kernighan published the first edition of The C Programming Language. This book, known to C programmers as "K&R", served for many years as an informal specification of the language. The version of C that it describes is commonly referred to as "K&R C." (The second edition of the book covers the later ANSI C standard, described below.) K&R introduced the following features to the language:
  • struct data types
  • long int data type
  • unsigned int data type
  • The =+ operator was changed to +=, and so forth (=+ was confusing the C compiler's lexical analyzer).
K&R C is often considered the most basic part of the language that is necessary for a C compiler to support. For many years, even after the introduction of ANSI C, it was considered the "lowest common denominator" that C programmers stuck to when maximum portability was desired, since not all compilers were updated to fully support ANSI C, and reasonably well-written K&R C code is also legal ANSI C. In the years following the publication of K&R C, several "unofficial" features were added to the language, supported by compilers from AT&T and some other vendors. These included:
  • void functions and void * data type
  • functions returning struct or union types
  • struct field names in a separate name space for each struct type
  • assignment for struct data types
  • const qualifier to make an object read-only
  • a standard library incorporating most of the functionality implemented by various vendors
  • enumerations
  • the single-precision float type
ANSI C and ISO C During the late 1970s, C began to replace BASIC as the leading microcomputer programming language. During the 1980s, it was adopted for use with the IBM PC, and its popularity began to increase significantly. At the same time, Bjarne Stroustrup and others at Bell Labs began work on adding object-oriented programming language constructs to C. The language they produced, called C++, is now the most common application programming language on the Microsoft Windows operating system; C remains more popular in the Unix world. In 1983, the American National Standards Institute (ANSI) formed a committee, X3J11, to establish a standard specification of C. After a long and arduous process, the standard was completed in 1989 and ratified as ANSI X3.159-1989 "Programming Language C". This version of the language is often referred to as ANSI C. In 1990, the ANSI C standard (with a few minor modifications) was adopted by the International Standards Organization (ISO) as ISO/IEC 9899:1990. One of the aims of the ANSI C standardization process was to produce a superset of K&R C, incorporating many of the unofficial features subsequently introduced. However, the standards committee also included several new features, such as function prototypes (borrowed from C++), and a more capable preprocessor. ANSI C is now supported by almost all the widely used compilers. Most of the C code being written nowadays is based on ANSI C. Any program written only in standard C is guaranteed to perform correctly on any platform with a conforming C implementation. However, many programs have been written that will only compile on a certain platform, or with a certain compiler, due to (i) the use of non-standard libraries, e.g. for graphical displays, and (ii) some compilers not adhering to the ANSI C standard, or its successor, in their default mode. C99 After the ANSI standardization process, the C language specification remained relatively static for some time, whereas C++ continued to evolve. (Normative Amendment 1 created a new version of the C language in 1995, but this version is rarely acknowledged.) However, the standard underwent revision in the late 1990s, leading to the publication of ISO 9899:1999 in 1999. This standard is commonly referred to as "C99". It was adopted as an ANSI standard in March 2000. The new features in C99 include: Interest in supporting the new C99 features appears to be mixed. Whereas GCC and several other compilers now support most of the new features of C99, the compilers maintained by Microsoft and Borland do not, and these two companies do not seem to be interested in adding such support. "Hello, World!" in C The following simple application prints out "Hello, World!" to the standard output file (which is usually the screen, but might be a file or some other hardware device). A version of this program appeared for the first time in K&R.

#include <stdio.h>

int main(void)
{
    printf("Hello, World!\n");
    return 0;
}

Programming tools See also References External links Programming Languages Ada | Algol | APL | BASIC | COBOL | C | C++ | C# | ColdFusion | Delphi | Eiffel | Forth | FORTRAN | Haskell | Java | JavaScript | Jython | Lisp | ML | Modula-2 | Oberon | Pascal | Objective-C | Perl | PHP | PL/I | Postscript | Powerbuilder | Prolog | Python | QBASIC | Ruby | Scheme | Smalltalk | Tcl/Tk | Visual Basic An early version of this article contained material from FOLDOC, used with permission.

This article is adapted from from Wikipedia All Wikipedia article text is available under the terms of the GNU Free Documentation License

Design Patterns by Erich Gamma

C Programming Language (2nd Edition) by Brian W. Kernighan

Refactoring: Improving the Design of Existing Code by Martin Fowler

Programming C#, Third Edition by Jesse Liberty

Windows Forms Programming in C# by Chris Sells

Programming .NET Components by Juval Lowy

The C++ Programming Language (Special 3rd Edition) by Bjarne Stroustrup

C++ How to Program (4th Edition) by Harvey M. Deitel

Microsoft ADO.NET (Core Reference) by David Sceppa

Software Project Survival Guide by Steve C McConnell

Essential ASP.NET With Examples in C# by Fritz Onion

The C++ Standard Library : A Tutorial and Reference by Nicolai M. Josuttis

C How to Program, Fourth Edition by Harvey M. Deitel

Effective C++: 50 Specific Ways to Improve Your Programs and Design (2nd Edition) by Scott Meyers

C++ for Dummies (4th Edition, Completely Revised) by Stephen Randy Davis


Recent C_programming_language related patents

From USPTO:
6718533: Method for building a real-time control system with mode and logical rate
6718504: Method and apparatus for implementing a data processor adapted for turbo decoding
6718469: System and method for executing computer virus definitions containing general purpose programming language extensions
6718248: System for detecting surface profile of a driving road
6718069: Method and system for reducing correlated noise in image data
6715145: Processing pipeline in a base services pattern environment
6715063: Call gate expansion for 64 bit addressing
6714962: Multi-user server application architecture with single-user object tier
6714928: Development system providing HTML database control object
RE38476: Signal processing apparatus
6711619: Method, system, and apparatus for distributing and using computer-based applications over a network
6708332: Run-time modules for dynamically adjusting computer operation
6708329: Method and apparatus for producing modules compatible with a target system platform from simulation system modules utilized to model target system behavior
6708310: Method and system for implementing user-defined codeset conversions in a computer system
6708211: Windows frame, dialog box, keyboard, device access and user environment real time ASC file signal tracking and control system based upon user activity
6708177: Method of formatting values in a fixed number of spaces using the java programming language
6708127: Beam propagation method for step-index waveguides
6707453: Efficient rasterization of specular lighting in a computer graphics system
6707452: Method and apparatus for surface approximation without cracks
6704927: Static binding of dynamically-dispatched calls in the presence of dynamic linking and loading
6704804: Method and system for communicating information among interactive applications
6704803: Method and system for distributing data events over an information bus
6704780: Efficient representation of system network management object identifiers
6701420: Memory management system and method for allocating and reusing memory
6701338: Cumulative status of arithmetic operations
6697784: Workflow management system, method, and medium with personal subflows
6697751: Apparatus for assessing communication equipment
6697620: Method and system for providing telecommunication services across networks that use different protocols
6697475: System and method for implementing an end office switch with enhanced functionality using an operating system independent distributed self-contained dynamic logic system
6696958: Method of detecting a fire by IR image processing
6694293: Speech coding system with a music classifier
6694290: Analyzing an extended finite state machine system model
6694270: Phasor transducer apparatus and system for protection, control, and management of electricity distribution systems
6692339: Combined chemical mechanical planarization and cleaning
6691301: System, method and article of manufacture for signal constructs in a programming language capable of programming hardware architectures
6691298: Memory management in embedded system with design time object instantiation
6691207: Method and apparatus for implementing loop compression in a program counter trace
6691147: Method and apparatus supporting network communications
6691122: Methods, systems, and computer program products for compiling information into information categories using an expert system
6690769: Hand-held telecommunication loop testing device
6690746: Signal recognizer for communications signals
6687833: System and method for providing a network host decoy using a pseudo network protocol stack implementation
6687702: Methodology providing high-speed shared memory access between database middle tier and database server
6687527: System and method of user guidance in magnetic resonance imaging including operating curve feedback and multi-dimensional parameter optimization
6687385: Method for steganographic encoding
6685310: Ink-jet recording apparatus
6684348: Circuit for processing trace information
6684265: System for assigning new alerts in response to a plurality of escaltion schemes or assigning an ignore scheme to the new alert
6682527: Method and system for heating tissue with a bipolar instrument

Bibliographic Resources
Updates and comments at Essential Facts blog
Are you interested in Feng Shui?
Price Theory Resources
Fructose, Sucrose, Glucose Core Bibliography
World Class Photographers
Some philosophical movements
Top PDF and eBook Downloads
©2004, All applicable rights reserved.