Macro substitution directives

We have already met this facility, in its simplest form it allows us to define textual substitutions using #define statement. The #define statement can be used for more, however, than simply defining symbolic constants. …

Read More »

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 …

Read More »

File operation

There are two distinct ways to perform the file operation in C: 1. Low level I/O operation (it uses UNIX system call therefore we won’t discuss here) 2. High level …

Read More »

Opening & closing a data file

When working with a stream-oriented data file, the first step is to establish a buffer area (a holt station for data processing) where information is temporarily stored while being transferred between the computer’s …

Read More »

Creating a data file

A data file must be created before it can be processed. A stream-oriented data file can be created in two ways. One is to create the file directly, using a text editor or a word processor. The …

Read More »

Processing a data file

Processing a data file Most data file applications require that a data file be altered as it is being processed. For example, in an application involving the processing of customer records, it may be …

Read More »

What is Structure?

The C language allows us to create custom data types. The structure is a custom data type which c combines different data types . The structure is a custom data …

Read More »

Structure Initialization

a structure variable can be initialization as any other data type. Main() { static struct { int weight; float height; } } student{560,080,75}; This assign the value 60 to student …

Read More »

Comparison of structure variables

Two variables of the same structure type can be compared the same way as ordinary variables. operation meaning person1=person2*assign perosn2 to person1 person1== person2*compare all name of person1 and person2 …

Read More »

Arrays of structures

The most common use of structures is in arrays of structures. To declare an array of structures, first the structure is defined then an array variable of that structure is …

Read More »

Arrays with in structures

Single as multidimensional arrays of type int as float can be defined as structure members. Example: struct marks { int number; float subject[3]; } student [2]; Here the member subject …

Read More »

Structures with in structures

Structures within a structure means nesting of structures. Example: struct salary { char name [20]; char department [10]; int basic-pay; int dearness-allowance; int huse_rent_allowance; int city_allowance; } employee; This structure …

Read More »