A Quick Reference to C Programming Language
A Quick Reference to C Programming Language
Structure of a C Program #include(stdio.h) #include... #define..
/* Declare global variables*/) (variable type)(variable list);
/* include IO library */ /* include other files */ /* define constants */
/* Define program functions */ (type returned)(function name)(parameter list) (declaration of parameter types) {
(declaration of local variables); (body of function code); } /* Define main function*/ main ((optional argc and argv arguments)) (optional declaration parameters) { (declaration of local variables); (body of main function code); }
Comments
Format: Example:
/*(body of comment)
*/
/*This is a comment in C*/
Constant Declarations
Format: Example:
#define(constant name)(constant value) #define MAXIMUM 1000
Type Definitions
Format: Example:
Variables Declarations: Format: Example:
typedef(datatype)(symbolic name); typedef int KILOGRAMS;
(variable type)(name 1)(name 2),...; int firstnum, secondnum;
Initializing: Format: Example:
Assignments: Format: Example:
Unions Declarations: Format:
Example:
Assignment: Format:
Structures Declarations: Format:
Example:
char alpha; int firstarray[10]; int doublearray[2][5]; char firststring[1O];
(variable type)(name)=(value); int firstnum=5;
(name)=(value); firstnum=5; Alpha='a';
union(tag) {(type)(member name);
(type)(member name); ...
}(variable name); union demotagname {int a;
float b; }demovarname;
(tag).(member name)=(value); demovarname.a=1; demovarname.b=4.6;
struct(tag) {(type)(variable);
(type)(variable); ...
}(variable list); struct student {int idnum;
int finalgrade; char lettergrade; } first,second,third;
Assignment: Format: Example:
(variable name).(member)=(value); first.idnum=333; second.finalgrade=92;
Operators Symbol +,-,*,/ % > >= < > ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- quick and dirty guide to c university of washington
- arm assembly language guide
- c reference card ansi constants flow of control program
- arrays definition example of an array named a of 5
- the c language reference manual
- chapter 6 data type
- c quick reference
- linguaggio c stringhe
- computer applications 86
- a quick reference to c programming language
Related searches
- c programming language standard
- c programming language specification
- c programming int to string
- which programming language to learn first
- best programming language to learn 2020
- the c programming language brian kernighan
- c programming language history
- c programming language pdf
- best programming language to learn
- which programming language to learn
- the c programming language pdf
- best programming language to know