Posts

Showing posts from December, 2016

Some Useful Functions

Image
typedef ◘ It is used to give another name to the previous or existing data type. ◘ It is not creating new data type. ◘ typedef data_type another_name ; Example- #define ◘ It is also called compiler directive. ◘ It is also called pre-processor ◘ It is used to define Symbolic constants. ◘ #define pi 3.14; ◘ It is also used to define mricros (small single line statement function) Example of micros, #include ◘ It is used to add contains of a file which is written inside the angular bracket < > . Example -               #include <iostream> * It will help to include fine iostream in our program. #if ◘ It is used to test whether a compiler time condition is true. #under ◘ It is used to un-define micros. #else ◘ It is used to specify the alternative . ◘ It used to perform an action if a test fail. #endif ◘ To end the pre-processor conditions. By - Somesh Sah

Structure

Image
In C++  " It is a collection of variables referred under one name.  " Structure can be Defined as - - struct is the keyword. - structure is a collection of related data types known as a members of structure. - It is very powerful. - In array , we group of same data type but in structure we can able to group different data types. - structure is always end up with a (;) semicolon . Now we have to makes the object of the structure student [ name_of_the_structure obj; ] Object -  - Is an run time entity. - It contains all the members and its functions - we can not use structure without making its object. - object of student S1 . - S1 has its own name , roll number and percent.  - like that we can create as many as objects. Note - The Members of the object can be assessed bu using ( . ) dot operator. Ques - Write a program to make a structure to enter book name and its author name then dis...

Array

Image
"Array - It is a collection of variable of same data type and referred under a common name." In C++ ,  the declaration of an array is  int a [10] ;                  where  int is a Data Type , it can b float, char etc.  a is a Name of the Array (under which it is referred) [ index number ] is a size of array and it is always started from 0 to size-1 . Two Types Of Array ♣ Single Dimensional Array  ♣ Two Dimensional Array ♣ Multi Dimensional Array # Single Dimensional Array - it store its elements in linear form. - it has continuous memory location. - the size of array is always positive.   Here we declarer an array with size of 5 elements. ( int a[5]; ) a[5] = {55,45,78,67,28} a[0] = 55 a[1] = 45 a[2] = 78 a[3] = 67 a[4] = 28 Note- 5001 , 5002, .... 5005 is know as address of the array elements (store in...