Home » Archives for December, 2009

Nested Structure

Nested Structure
Nested Structure: When members of a structure are defined as structure type, these are called nested structures. For example: struct info { char s_name[15]; char f_name[15] ; char city[15] ; int age; }; struct p_data { info s1; info s2; float x; }; p_data rec; In the above example, info structure is defined with four members. The structure p_data is defined after the info and... 

Structure Variables as Arrays

Structure Variables as Arrays
Structure Variables as Arrays: A structure variable may also be declared as an array. This is done to manage a large number of records. Each variable of the array represents a complete record. For example, in the following example the structure variable arts are of array type. It contains 10 elements. Each element can store one record. struct result { char s_name [15]; int sub [4] ; int total; }; result... 

Array Type Members of Structures

Array Type Members of Structures
Array Type Members of Structures: The members of structure may be of different types. These can also be simple variables or array variables. For example, in the following structure, the member “sub” is an array of int type. It has four elements. The member “name” is of string type and a string is also an array. struct rec { char name [15]; int sub [4] }; Method to access the elements of... 

Initialization of Structure Variables

Initialization of Structure Variables
Initialization of Structure Variables: The values into a structure variable can be assigned when it is declared. It is called initialization of the structure variable. To initialize a structure variable, data is assigned to the members of the structure. To assign data to the members of the structure, the data items are written in the same order in which these have been defined in the structure. The... 

Structure Variable

Structure Variable
Structure Variables: A structure is a collection of data items or elements. It is defined to declare its variables. These are called structure variables. A variable of structure type represents the members of its structure. When a structure type variable is declared, a space is reserved in the computer memory to hold all members of the structure. The memory occupied by a structure variable is equal... 

C++ Structures

C++ Structures
C++ Structures: A structure is a collection of related elements or data items. The elements of the structure are called members of the structure. A structure is unlike an array. All elements in an array are of the same type. But in structures, the elements can be of different types. The syntax of a structure is very similar to that of a class in C++.  The structures are commonly used in file processing.... 

Built-In Function of Math

Built-In Function of Math
Built-In Function of Math: The functions that are used to perform mathematical calculations are defined in “math.h” header file. The commonly used math library functions are discussed below. The “pow” Function: It is used to calculate the exponential power of a given integer number. Its syntax is: pow (x ,y); Where x : is an integer number whose power is to be calculated. y : is an integer... 

Built-In Function of String

Built-In Function of String
Built-In Functions of String: The “string.h” header file contains the functions that are used to process strings. The commonly used functions of this header file are given below. The “strlen” Function: The “strlen” stands for string length. This function is used to find the length of a string. It counts the total number of characters including spaces. Null character is excluded. Its syntax... 

Standard Input and Output Functions C++

Standard Input and Output Functions C++
Standard Input and Output Functions C++: The “stdio” stands for standard input/output. This header file contains a large number of standard Input and Output functions that are used to get input from tile input devices and also to print results on output devices. The commonly used functions of this header file and their description is given below. The “getchar” Function: This function is... 

Common C++ Built-In Functions

Common C++ Built-In Functions
Common C++ Built-in Functions: The commonly used built-in functions are discussed below: The “conio.h” Function: The “conio.h” stands for console input/output. This header file contains basic input & output functions that are used to get data from the keyboard and to send results from the memory to the output screen. A brief description of commonly used functions of this header file is... 
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Copyright © 2010 Information Village. All rights reserved.