Newsletter

Encyclopedia

Results found for: C
 

C

(1) See coulomb.

(2) A high-level programming language developed at Bell Labs that is able to manipulate the computer at a low level like assembly language. During the last half of the 1980s, C became the language of choice for developing commercial software. C, and its object-oriented successor C++, are used to write a huge variety of applications and almost all operating systems. There are C/C++ compilers for all major operating systems and hardware platforms. C was standardized by ANSI (X3J11 committee) and ISO in 1989. See C++ and C#.

Nothing But Functions
C and C++ are written as a series of functions that call each other for processing. Even the body of the program is a function named "main." Functions are very flexible, allowing programmers to choose from the standard library that comes with the compiler, to use third party libraries or to develop their own.

Its Origin
C was developed to allow Unix to run on a variety of computers. After Bell Labs' Ken Thompson and Dennis Ritchie created Unix and got it running on several PDP computers, they wanted a way to easily port it to other machines without having to rewrite it from scratch. Thompson created the B language, which was a simpler version of the BCPL language, itself a version of CPL. Later, in order to improve B, Thompson and Ritchie created C.

     Compared to many other high-level programming languages, C appears somewhat cryptic. The following C example converts Fahrenheit to centigrade:

main() {
float fahr;
printf("Enter Fahrenheit ");
scanf("%f", &fahr);
printf("Celsius is %f\n", (fahr-32)*5/9);
}




The DOS Version in C

Following is the main event loop in the first software engine used for this encyclopedia. Written in Turbo C, the main loop of an interactive program repeats continuously, testing all possible menu selections, keystrokes and mouse clicks that the user may enter.

     The WHILE (1) statement below creates a continuous loop. An instruction at the END OF EVENT LOOP points to the beginning of the loop.

     The names with double parentheses are the names of subroutines, for example, bookmark(). When bookmark() is called, the instructions in the bookmark function set the bookmark and control is returned to the BREAK. The BREAK ends the loop in order to start over at the beginning.

/*********** MAIN EVENT LOOP **********/
while (1) /* BEGINNING OF LOOP */
{
while (!charwait()) if (mouse) testMOUSE();
if (mouse)
{
if (mouseDOWNinText)
{
mouseDOWNinText=0;
CLICK=1;
unHighLightALL();
}
}
key1=getch(); /* get keystroke from keyboard */
if (key1==0) /* if 0, a second character is */
{ /* required (key2) */
key2=getch(); /* get second character */
switch (key2) { /* test contents of key2 */
case 59: HelpTopic=NO;
HelpRoutine(); break; /* F1*/
case 68: main_menu(); break; /*F10*/
case 61: PrevHistory(); break; /* F3*/
case 62: NextHistory(); break; /* F4*/
case 63: bookmark(); break; /* F5*/
case 64: findmark(); break; /* F6*/
case 71: home_key(); break;
case 79: end_key(); break;
case 75: left_arrow(); break;
case 77: left_arrow(); break;
case 72: up_arrow(); break;
case 80: down_arrow(); break;
case 73: pageup(); break;
case 81: pagedown(); break;
case 132: ctrl_PgUp(); break;
case 118: ctrl_PgDn(); break;
      }
}
else
{
switch (key1) {
case 8: backspace(); break;
case 9: left_arrow(); break; /*Tab*/
case 127: ctrl_bsp(); break;
case 13: return_key(); break;
case 27: escape_key(); break;
case 2: bookmark(); break; /*Ctrl-B*/
case 6: findmark(); break; /*Ctrl-F*/
case 24: alldone(); /*Ctrl-X*/
case 17: alldone(); /*Ctrl-Q*/
default: dataentry(); break;
      }
}
} /** END OF EVENT LOOP **/





similar terms
Entries before C
bytecode
byte-oriented protocol
byte serving
byte sex
bytesexual
Entries after C
C-band
C/C++
C drive
C-I-A
c/s
 




Or get a random definition
techweb
copyright THIS COPYRIGHTED DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.

Copyright (©) 1981-2007 The Computer Language Company
Inc All rights reserved.
 Featured Jobs
Ascension Health seeking Solutions Development Analyst in St. Louis, MO

National Semiconductor seeking Principal IC Design Engineer in Santa Clara, CA

Taylor Guitars seeking Sr. Web Designer in El Cajon, CA

Covidien seeking Hardware Manager in Boulder, CO

Sierra Nevada seeking Software Engineer in Hagerstown, MD

More jobs on EETimesCareers
 Sponsor