Home > Programming > C Programming Language

C Programming Fundamentals

Sort Desciption:

1 C Programming Fundamentals C is a compiled language. The user creates source code (often ... exe extension). Below is typical C program called LED.C that illustrates some fundamental C ...



Content Inside:

1 C Programming Fundamentals C is a compiled language. The user creates source code (often with the extension .c) in C syntax. The user then compiles the source code and an object file (normally has an .obj extension) is generated if there are no syntax errors.  The compiler then proceeds to link the object file or files which creates the final executable file (often with the .exe extension). Below is typical C program called LED.C that illustrates some fundamental C syntax: printf Function printf is used to write output to the monitor.  Text contained between starting and ending quotation marks are sent verbatim to the monitor.  Control characters, also added to format output.  For example, , is used to generate carriage return. /* FILENAME: LED.C   AUTHOR:   PAUL OH   DATE:     10/02/00   NOTES:    USER ENTERS DECIMAL NUMBER, 8255 LIGHTS LED */ #include<stdio.h> #include<stdlib. h> void main(void) {  int i;  int controlWord, portA, baseAddress;  int myNumber;  baseAddress = 608;  portA = baseAddress;  controlWord = baseAddress + 3;  outportb(controlWord, 128);  printf("Enter decimal number between 0 and 255 or 999 to exit: ");  scanf("%d", &myNumber);  while(myNumber != 999)  {     if(myNumber == 999)     {       printf ("Exiting Program ");       exit(0 );     }     outportb(portA,  myNumber);     printf("Enter decimal number between 0 and 255 or 999 to exit: ");     scanf("%d", &myNumber);  } } Comment lines begin with /* and end with */  and are ignored by the compiler Header files have an .h extension. These are 2 must be includ ...

Source: www.pages.drexel.edu


add to Google Reader add to Google Bookmark add to bloglines add to newsgator add to FURL add to digg add to webnews add to Netscape add to Yahoo MyWeb add to spurl.net add to diigo Bookmark newsvine Bookmark del.icio.us Bookmark @ SIMPIFY Bookmark MISTER WONG Bookmark Linkarena Bookmark icio.de Bookmark oneview Bookmark folkd.com Bookmark yigg.de Bookmark reddit Bookmark StumbleUpon Bookmark Slashdot Bookmark blinklist Bookmark technorati add to blogmarks add to blinkbits add to ma.gnolia add to smarking.com add to netvouz add to co.mments add to Connotea add to de.lirio.us

 

Related Files

C Programming

Filed under: Programming and C Programming Language
The C Programming Language ANSI C. By Brian W. C. Kernighan & Dennis M. Ritchie. K and R. "Practical C programming". By Steve ...

C Programming Fundamentals

Filed under: Programming and C Programming Language
1 C Programming Fundamentals C is a compiled language. The user creates source code (often ... exe extension). Below is typical C program called LED.C that illustrates some fundamental C ...

Programming in C C++ Java

Filed under: Programming and C Programming Language
Programming in C C++ Java. Course Overview. Object oriented programming languages are widely used for the development of complex software systems. ...