Let us start
Before you can do anything in any language and start programming, you must know how to name an identifier. An identifier is used for any variable, function, data definition, etc. In the C programming language, an identifier is a combination of alphanumeric characters, the first being a letter of the alphabet or an underline, and the remaining being any letter of the alphabet, any numeric digit, or the underline.
Two rules must be kept in mind when naming identifiers.
- The case of alphabetic characters is significant. C is a case sensitive language. That means Recovery is different from recovery and rEcOveRY is different from both mentioned before.
- According to the ANSI-C standard, at least 31 significant characters can be used and will be considered significant by a conforming ANSI-C compiler. If more than 31 are used, all characters beyond the 31st may be ignored by any given compiler
There are 32 words defined as keywords in C. These have predefined uses and cannot be used for any other purpose in a C program. They are used by the compiler as an aid to compiling the program. They are always written in lower case. A complete list follows:
Here we see the magic of C. The wonderful collection of only 32 keywords gives a wide use in different applications. Any computer program has two entities to consider, the data, and the program. They are highly dependent on one another and careful planning of both lead to a well planned and well written program.
Let us begin with a simple C program:
/* First Program to learn C */
printf("This is a C program\n"); // printing a message
Though the program is very simple, a few points are worthy of note. Let us examine the above program. Everything that is inside /* and */ is considered a comment and will be ignored by the compiler. You should not include comments within other comments, so something like this is not allowed:
/* this is a /* comment */ inside a comment, which is wrong */
There is also a way of documentation that works within a line. By using // we can add small documentation within that line.
|Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Publishers of the Book
Number of Pages
Price of the Book
BPB Publications, New Delhi, India
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)