Saturday 26 May 2012

Keywords And Identifiers

C Programming Keywords Identifiers :
Every C word is classified as either a keyword or an identifier. All keywords have fixed meanings and these meanings cannot be changed. Keywords serve as basic building blocks for program state¬ments. The list of all keywords of ANSI C are listed in Table 2.3. All keywords must be written in lowercase. Some compilers may use additional keywords that must be identified from the C manual.


Identifiers refer to the names of variables, functions and arrays. These are user-defined names and consist of a sequence of letters and digits, with a letter as a first character. Both uppercase and lowercase letters are permitted, although lowercase letters are commonly used. The underscore character is also permitted in identifiers. It is usually used as a link between two words in long identifiers.


Thursday 17 May 2012

C Tokens

C Programming:
In a passage of text, individual words and punctuation marks are called tokens. Similarly, in a c program the smallest individual units are known as C tokens. C has six types of tokens as shown in Fig. C programs are written using these tokens and the syntax of the language.

C Tokens

Friday 11 May 2012

Character Set


Character Set: 
The characters that can be used to form words, numbers and expressions depend upon the computer on which the program is run. However, a subset of characters is available that can be used on most personal, micro, mini and mainframe computers. The characters in C are grouped into the following categories:
1. Letters
2. Digits
3. Special characters
4. White spaces
The entire character set is given in Table .
The compiler ignores white spaces unless they are a part of a string constant. White spaces may h, used to separate words, but are prohibited between the characters of keywords and identifiers.

Character Set

Trigraph Characters:
Many non-English keyboards do not support all the characters mentioned in Table . Trigraph- sequences to provide a way to enter certain characters that are not available on some keyboards. Each trigraph sequence consists of three characters (two question marks followed by another character) as shown in Table .


Trigraph Characters





Sunday 6 May 2012

MS-Dos System

The program can be created using any word processing software in non-document mode. The file name

should end with the characters ".c" like program.c, pay.c, etc. Then the command

MSC pay . c


under MS-DOS operating system would load the program stored in the file pay.c and generate the object code. This code is stored in another file under name pay.obj. In case any language errors are found, the compilation is not completed. The program should then be corrected and compiled again.
The linking is done by the command


LINK pay .obj


which generates the executable code with the filename pay.exe. Now the command

pay

would execute the program and give the results.