For All Human Beings.......

Saturday, April 26, 2008

typedef

USER DEFINED DATA TYPES : typedef


We have already seen a data type that is defined by the user (programmer): The structures. But in addition to these there are other kinds of user defined data types:

Definition of own types (typedef)

C++ allows us to define our own types based on other existing data types. In order

to do that we shall use keyword typedef, whose form is:

typedef existing_type new_type_name ;

where existing_type is a C++ fundamental or any other defined type and new_type_name is the name that the new type we are going to define will receive. For example:

typedef char C;
typedef unsigned int WORD;
typedef char * string_t;

Click here for detailed notes.........


Tuesday, April 22, 2008

Assignment : Structure in C++

Posting the assignment on structure (User defined Data type). The questions are to be done in assignment register.

Click Here for Assignment(pdf format).......
..

User Defined Data Type in C++ : Structure

Structures in C++

A structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths. Structures are declared in C++ using the following syntax:

struct structure_name
{
member_type1 member_name1;
member_type2 member_name2;
member_type3 member_name3;
:
:
} object_names;

example :

struct
product
{
int weight;
float price;

} ;

product apple;
product banana, melon;

Subtopics Covered

  • Defining a Structure

  • Declaring structure variables

  • Accessing structure elements

  • Passing structure to Functions as value and reference argument/parameter

  • Function returning structure

  • Array of structures

  • passing an array of structure as an argument/ a parameter to a function

Tuesday, April 15, 2008

Data Structures (1 D & 2 D Arrays)

Array

It is a static data structure. It is a homogeneous collection of data. The elements in the array are stored on consecutive memory locations. Array is also known as a subscripted variable, e.g., A[i] is ith element of the array A (i.e., i is the subscript with variable A). As we know that the elements of the array are stored on consecutive memory locations, it becomes convenient to find out the address of memory location of ith element, for given base address (address of first element) and W (i.e. the number of memory locations required by one element).

Different Operations on 1 D ARRAYS

  • Creation
  • Traversal
  • Insertion
  • Deletion
  • Searching
    • Linear
    • Binary Search
  • Sorting
    • Bubble Sorting
    • Selection Sorting
    • Insertion Sorting
  • Merging

Different Operations on 2 D ARRAYS

  • Creation
  • Printing (Traversal)
  • Addition of two Matrix
  • Difference Matrix
  • Multiplication of Matrix
  • Row / Col Sum
  • Diagonal Sum
  • Transpose Matrix
For Functions on ARRAYS Click Here ..........

Monday, April 7, 2008

LIST OF PROGRAMS FOR CLASS XII (2008-09)

The programs which are to be completed during the session 2008-09 are given in pdf format. These programs are listed topic wise and are to be completed during practical sessions. For Complete list of programs


click Here......

Assignment : 1D Array & 2D Array



Posting the assignment covering 1D and 2D Arrays. The functions are to be written in assignment register. This assignment will help in attempting questions in theory paper also.

Date Of Submission : 15th April, 2008
(Class XII C)