c

43 Results

Dictionary

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 **/





Sponsored White Papers, Webcasts & Resources

  • 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.

    Blog posts | May 24, 2012 7:47am PDT

  • 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.

    Blog posts | March 19, 2012 8:05am PDT

  • 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.

    Blog posts | March 8, 2012 9:33pm PST

  • 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.

    Blog posts | October 14, 2011 10:05pm PDT

  • 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.

    News items | October 13, 2011 8:25am PDT

  • 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.

    Blog posts | September 23, 2011 8:45am PDT

  • 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.

    Blog posts | February 22, 2011 6:45am PST

  • 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...

    Blog posts | January 18, 2011 7:21am PST

  • 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...

    Blog posts | June 9, 2010 8:51am PDT

  • 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,...

    Blog posts | May 20, 2010 8:39am PDT

  • 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,...

    Blog posts | February 3, 2010 11:07am PST

  • 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!

    Blog posts | February 2, 2010 7:36am PST

  • 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...

    Blog posts | January 20, 2010 9:31pm PST

  • 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...

    Blog posts | August 18, 2009 6:27pm PDT

  • 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...

    Blog posts | June 25, 2009 3:00pm PDT

ie8 fix

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

ie8 fix