C

Fundamental concept of Problem solving
Introduction
Problem solving strategies
Program design & implementation
Introduction to C
Introduction to C
How to open C program code window
Description of C code window
Editing File
Saving and Running a program
The components of C language
Structure of C Program
A sample of C language program
C character set and keywords
C character set and keywords
The C character set
Identifiers
Key words
Data Types
Data Types
Primary Data Type
Secondary Data Type
Variables
Introduction
Rules for constructing variables names
Variable declaration
Assigning values to variables
Scope of variables: Local & Global
Constants
Introduction
Character constants
Integer constants
Real constants
Logical & String constants
C instruction set
Introduction
Type Declaration & Input/Output Instructions
Arithmetic Instructions
Control Instructions
Operators
Introduction
Arithmetic operators
Relational operators
Logical operators
Increment & Decrement operators
Bitwise operators
Conditional & ternary operators
The comma operators
Size of operator
Assignment operator
Type modifier
Expressions
Evaluation of expression
Automatic type conversion
Basic Input/Output
Introduction
Console I/O function
Disc & Port I/O function
Control Structures
Sequence control statements
Decision control & conditional statements
Case control statements
Repitition & loop control statements
Some more statements
Array and String
Introduction of Array
Array Declaration
Array Initialization
Two Dimensional Array
Multi Dimensional Array
String
Function and Recursion
Function Definition
Function Declaration
Function Call
Recursion
Pointers
Introduction
Pointer expression
Pointer & functions
Pointer & Array
Multi Dimensional Arrays & Pointer
Arrays of Pointer
Use of Pointer & functions
Structures
Introduction
Giving values to member
Structure Initialization
Comparison of structure variables
Arrays of structures
Arrays within structures
Structures within structures
Passing structure to function
Union
Introduction
Accessing a union member
Initialization of Union variable
Uses of Union
Dynamic Data Structure
Linked list
Stack
Queue
Data File Handling through C
Introduction
File operation
Opening & closing a data file
Creating a data file
Processing a data file
Unformatted data file
C Preprocessor & Macro
Introduction
Macro substitution directives
File inclusion
Compiler control directive
Command line parameter of C
Command line parameter
Header file
Header file
Use of library functions
Some Useful library functions

C Preprocessor & Macro


Compiler control directive

The C Preprocessor offer a feature known as conditional compilation, which can be used to switch on or off a particular line or group of lines in a program.
 
This is achieved by the inserting #ifdef or #endif.
 
Conditional selection of code using #ifdef,#endif.
 
The preprocessor has a conditional statement similar to' C's if else.
 
It can be used to selectively include statements in a program. This is often used where two different computer types implement a feature in different ways. It allows the programmer to produce a program which will run on either type.
 
The keywords for conditional selection are; #ifdef, #else and #endif. #ifdef
 
takes a name as an argument, and returns true if the name has a current definition. The name may be defined using a #define, the -d option of the compiler.
 
#else
 
is optional and ends the block beginning with #ifdef. It is used to create a 2 way optional selection.
 
#endif
 
ends the block started by #ifdef or #else.
 
Where the #ifdef is true, statements between it and a following #else or #endif are included in the program.
 
Where it is false, and there is a following #else, statements between the #else and the following #endif are included.
 
This is best illustrated by an example.
 
Using #ifdef for Different Computer Types
 
Conditional selection is rarely performed using #defined values. A simple application using machine dependent values is illustrated below:
 
 
Output of the program
 
 
Note: sun is defined automatically on SUN computers. vax is defined automatically on VAX computers. ibm is defined automatically on IBM pc's else type not defined message will be displayed (different types of computer)
 
Using #ifdef to Temporarily Remove Program Statements
 
#ifdef also provides a useful means of temporarily "blanking out" lines of a program.
 
The lines in question are preceded by #ifdef NEVER and followed by #endif. Of course you should ensure that the name NEVER isn't defined anywhere.