c
43 ResultsDictionary
C
(1) See coulomb. (2) A high-level programming language developed at Bell Labs that is also able to manipulate the computer at a low level like assembly language. Developed in the 1970s, by the...
Dictionary
Definition: C
(1) See coulomb.
(2) A high-level programming language developed at Bell Labs that is also able to manipulate the computer at a low level like assembly language. Developed in the 1970s, by the end 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.
C++ (C Plus Plus)
Created by Bjarne Stroustrup and renamed from "C with Classes" to C++ in 1983, the language became popular because it combined traditional C with object-oriented programming (OOP). In contrast, Smalltalk (the first OOP language) and other OOP languages did not provide the familiar structures of conventional languages such as C and Pascal. See object-oriented programming, Visual C++, Objective C, C# and Managed 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.
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 */
if (key1==0) /* if 0, 2nd char is */
{ /* required (key2) */
key2=getch(); /* get 2nd char */
switch (key2) { /* test 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; /*Ctl-B*/
case 6: findmark(); break; /*Ctl-F*/
case 24: alldone(); /*Ctl-X*/
case 17: alldone(); /*Ctl-Q*/
default: dataentry(); break;
}
}
} /** END OF EVENT LOOP **/
THIS DEFINITION IS FOR PERSONAL USE ONLY
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2010 The Computer Language Company Inc. All rights reserved.
Sponsored White Papers, Webcasts & Resources
-
Get Your Free Trial of Diskeeper 2011 - Server Edition
Increase performance and efficiency for the most powerful systems in your network--the servers. Discover how Diskeeper 2011 prevents disk fragmentation before it happens and optimizes data flow...
-
Disaster recovery needs leading SMBs to cloud
At least one-third of small businesses in a Symantec study pointed to data backup as a big consideration for their move to the cloud, echoing other research.
-
2012 Toyota Prius C (photos)
Toyota's smallest Prius is a little hatchback with a modern design and dimensions very suitable for city parking.
-
Duqu Trojan programming language identified
Security firm Kaspersky asked the programming community to identify a section of the Duqu Trojan it says was partly written in an unrecognized programming language. Now it finally has the answer: C.
-
Trenton Computer Festival, the early days of computing, and me
TCF is unlike any other computer event in the world. It's special. It's unique. In a way, the birthplace of DIY-IT was the Trenton Computer Festival.
-
Without Dennis Ritchie, there would be no Jobs
Modern computing as we know it would not have existed without Dennis Ritchie, father of the C programming language and Co-creator of the UNIX operating system.
-
-
Dennis Ritchie, father of Unix and C, dies
The C programming language rests in the hearts of programmers as the quintessential expression of coding elegance, power, simplicity and portability.
-
Social media's attention problem (or maybe it's just me)
Is social media getting too social for its own good? Editor Andrew Nusca explains why he's falling out of love with Facebook and others.
-
LG Optimus C hands-on (photos)
The LG Optimus C is the same as all the other Optimus phones, but for Cricket Wireless.
-
Mercedes-Benz C coupe and C63 AMG wagon (photos)
Mercedes-Benz is digging into its excellent C-class model, expanding the forms it takes with a new coupe version and a station wagon of its C63 AMG. Good times are in store for C-class buyers.
-
Sony unveils new Vaio C laptops that 'radiate light'
Sony has unveiled the radiant Vaio C laptop series, which are garnering extra looks given that these notebooks radiate light around the edges of the machine and even around the touchpad.
-
Rumored iPad 2 cases reveal possible Mini DisplayPort spot
As if there hasn't been enough discussion about the iPad 2 in the last few days, weeks and months, now we have leaked images and rumors about the cases. Could Apple's next-gen tablet sport a Mini...
-
Ford C-Max and C-Max Energi (photos)
Ford showed off the U.S. version of its C-Max model, already sold in Europe, at the 2011 Detroit auto show. Along with this introduction, the company brought out the C-Max Energi, Ford's first...
-
Taking some heat ... and turning it into electricity
Harnessing heat for useful purposes isn't really anything new. Um, that's kind of what steam does and has been doing for more than 100 years. I actually wrote a few months ago about a data center...
-
Power play: Green efficiency means more to CFOs than green IT
Just spent three informative days at the Uptime Institute's Symposium 2010 and am sorting through all the notes I took. I don't think it will surprise you to hear that one of the dominant,...
-
Will your new Windows 7 PC support XP Mode?
Last year, when I looked at Intel CPUs, I identified a potential sticking point for Windows 7 upgraders: many then-current CPU models didn't support hardware-assisted virtualization. A year later,...
-
Build your own Home Theater PC (HTPC) ... for under $600!
Over the past few weeks I've had dozens of requests from readers wanting me to put together a parts list for a kick-ass, low-cost Home Theater PC (HTPC). Well, here you go!
-
Teens use media 8 hours a day: thanks, Dr. Obvious
The media aren't the problem here, folks. Kids can not only handle rivers of information but actually enjoy being immersed in them. Being hyper-connected doesn't stress them out like it does so...
-
T to the C to the O: Know your costs
So we’ve talked about ECM and MPS and DMS, but today let’s discuss three other letters I’ve gotten to know and love: TCO. Well, it’s not that I love total cost of ownership exactly....
-
A bit of global warming data to accept or dismiss as is your wont
NOAA has reported that July, 2009, produced the hottest ocean surface temp on record. Of course, those records don't reach back millenia to previous climate changes. Those careless Cro-Magnon...
-
JavaScript speed test: iPhone 3G S whips Palm Pre and Google G1
Users are very interested in smartphone performance because they are using smartphones more than ever. A new test compares JavaScript performance on the iPhone, Palm Pre, and Google G1. The iPhone...
The best of ZDNet, delivered
ZDNet Newsletters
Get the best of ZDNet delivered straight to your inbox




