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.
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 **/
(C Sharp) An object-oriented programming language from Microsoft and ECMA that is based on C++ with elements from Visual Basic and Java. Like Java, C# provides automatic garbage collection, whereas traditional C and C++ do not. C# was created by Microsoft and also standardized by the European Computer Manufacturers Association (ECMA). Microsoft designed C# as its flagship programming language for the .NET environment. See .NET.
An object-oriented version of C that has been widely used to develop enterprise and commercial applications. Created by Bjarne Stroustrup, C++ became popular because it combined traditional C programming with object-oriented programming (OOP) features. Smalltalk and other OOP languages did not provide the familiar structures of conventional languages such as C and Pascal. Microsoft's Visual C++ is the most widely used C++ language. See object-oriented programming, C, Visual C++, C# and Managed C++.
The designation for the primary hard disk in a Windows PC. The C: evolved from the early personal computers that used A: and B: for their two floppy drives. When the hard disk came along, it naturally became the C: drive. Letters starting with D: and up are used for additional hard disks and CD/DVD drives.
Computer Desktop Encyclopedia THIS DEFINITION IS FOR PERSONAL USE ONLY
All other reproduction is strictly prohibited without permission from the publisher.
Copyright © 1981-2009 by Computer Language Company Inc. All rights reserved.
| Topic | Replies | Latest Post |
|---|---|---|
| f u c k | 8 | 2 weeks ago |
| Enumeration of postings & c | 8 | 5 years ago |
Browse dictionary definitions near C
Share on Facebook