Tuesday, September 17, 2013

Posted by Unknown On 5:03 AM No comments
Static Stack #include<iostream.h>#include<conio.h>#define size 4 class stack{     int data[size];     int top;public:     stack()     {          top=-1;     }     void push();     void pop();     void...

Wednesday, September 11, 2013

Pointer

Posted by Unknown On 5:34 AM No comments
Pointer C++ Memory Map Once a program is compiled, C++ creates four logically distinct regions of memory:Code Area : Area to hold the compiled program codeData Area : Area to hold global variablesStack Area : Area to hold the return address of function calls, argument passed to the functions, local variables for functions and the current state of the CPU.Heap : Area from which the memory is dynamically allocated to the program. Accessing...

Tuesday, September 10, 2013

Basic Operation On Text File In C++

Posted by Unknown On 6:02 AM No comments
Basic Operation On Text File In C++ Program to write in a text file #include<fstream.h>int main(){     ofstream fout;     fout.open("out.txt");     char str[300]="Time is a great teacher but unfortunately it kills all its pupils. Berlioz";     fout<<str;     fout.close();     return 0;} Program to read from text file and display it #include<fstream.h>#include<conio.h>int main(){    ...

Data File Handling In C++

Posted by Unknown On 5:59 AM No comments
Data File Handling In C++ File. The information / data stored under a specific name on a storage device, is called a file. Stream. It refers to a sequence of bytes. Text file. It is a file that stores information in ASCII characters. In text files, each line of text is terminated with a special character known as EOL (End of Line) character or delimiter character. When this EOL character is read or written, certain internal translations take place. Binary file. It is a file that contains information in the same format...

Inheritance

Posted by Unknown On 5:58 AM No comments
Inheritance Inheritance:It is the capability of one class to inherit properties from another class. Base Class: It is the class whose properties are inherited by another class. It is also called Super Class. Derived Class:It is the class that inherit properties from base class(es).It is also called Sub Class. Forms Of Inheritance Single Inheritance: It is the inheritance hierarchy wherein one derived class inherits from one base...

Constructor and Destructor

Posted by Unknown On 5:54 AM No comments
Constructor and Destructor Constructor It is a member function having same name as it’s class and which is used to initialize the objects of that class type with a legel initial value. Constructor is automatically called when object is created. Types of Constructor Default Constructor-: A constructor that accepts no parameters is known as default constructor. If no constructor is defined then the compiler supplies a default constructor. student :: student(){     rollno=0;      marks=0.0; } Parameterized...

Monday, September 9, 2013

Class & Objects

Posted by Unknown On 9:30 AM No comments
Class & Objects The mechanism that allows you to combine data and the function in a single unit is called a class. Once a class is defined, you can declare variables of that type. A class variable is called object or instance. In other words, a class would be the data type, and an object would be the variable. Classes are generally declared using the keyword class, with the following format: class class_name {   private:      members1;   protected:      members2;   public:      members3;}; Where...

OOP Concepts

Posted by Unknown On 9:27 AM No comments
OOP Concepts Paradigm-: It means organizing principle of a program. It is an approach to programming. Procedural ParadigmIn procedural programming paradigm, the emphasis is on doing things i.e., the procedure or the algorithm. The data takes the back seat in procedural programming paradigm. Also, this paradigm does not model real world well. Object Oriented programmingThe object oriented programming paradigm models the real world well and overcomes the shortcomings of procedural paradigm. It views a problem in terms...