Home » Archive

Articles in the C and C++ Category

C and C++, Tech Corner »

[14 Oct 2009 | No Comment | Posted By:Dileep]

Data stored in program variables and arrays are temporary in nature. Such data is normally stored in the main memory(RAM) of the computer and it will be lost when the program. The best way to work with or process a large data is to store that data permanently in the computer’s memory.
To store data permanently we can use the secondary storage devices such as hard disks and magnetic tapes.
The data stored on the secondary storage devices is viewed as the data files.

File

A data file(or simply file) is a collection of …

Read the full Post »

C and C++, Tech Corner »

[13 Oct 2009 | No Comment | Posted By:Dileep]

Preprocessor – This is a macroprocessor that processes the source program before it is compiled. It is a collection of special statements called preprocesor statements or preprocessor directives.
These directives are executed before the C program passes through the compiler.

//

Preprocessor Directives – These are statements which begin with the # symbol placed in the first coloumn.
They are placed before the function main().
There will be no smicolon at the end of such statements.
Three types -

Macro substitution directives
File inclusion directives
Conditional compilation directives

Macro Substitution

This is a process of replacing an identifier of a …

Read the full Post »

C and C++, Tech Corner »

[11 Oct 2009 | No Comment | Posted By:Dileep]

To know where exactly the value of a variable is stored in the memory, you need to be aware of the concept called pointers.
A pointer is a powerful construct of the C programming language.
A pointer is a variable which holds the address of other variables such as arrays, structures and functions that are used in a program.
It contains only the memory location of the variable rather than its content.

Advantages

To point to different data structures.
Manipulation of data at different memory locations is easier.
To achieve clarity and simplicity.
More compact and efficient coding.
To …

Read the full Post »

C and C++, Tech Corner »

[31 Aug 2009 | 2 Comments | Posted By:Dileep]

An array is used to store and process a group of homogeneous elements. But, to store and process eleents that are not homogeneous, the knowledge of the structure is required. Structures help in packing the disimilar data items under a single name.
A structure is a meaningful collection of data items of different type. But it collects all elements under a unique name. A structure allows the programmer to create and manipulate a set of different types of data items.
The keyword struct.

Each and every structure must be defined and declared before …

Read the full Post »

C and C++, Tech Corner »

[23 Aug 2009 | No Comment | Posted By:Dileep]

A string is nothing but an array of characters.
Two strings can be compared, concatenated or copied. We can convert upper case letters into the lower case letters and vice-versa. Strings can be reversed. We can also check for the substrings present in the given string.

String is a one-dimensional array of characters.
Each one-dimensional character array(string) ends with a null character. So an n-character array contains (n+1) array elements.
C language provides many string handling functions which are defined in the header file .
Like a numeric array, character arrays must be declared before …

Read the full Post »