C# Language : Getting Started

C# is programming language from Microsoft. How different is it from other languages provided by Microsoft, well its managed. If you remember even Microsoft has released a version of Java VJ++ after Sun Java became popular. However after the sued by Sun, Microsoft has stopped releasing any further version of Visual J++. But They come [...]

Continue reading →

Various types of Function overloading (compile time polymorphism / static binding)

Polymorphism means same entity behaving differently at different times. Compile time polymorphism is also called as static binding. Compile time or static binding means Function body is bind to the function call at compile time itself.  In C++ compile time polymorphism can be achieved using Function overloading and operator overloading. Function overloading Function overloading means, [...]

Continue reading →

C++ : Explain constructors Usage

To initialize an object of a class, we need a constructor. We can use default constructor provided by compiler or we can overload constructors or override zero argument constructor similar to default constructor. Constructor Ex. It does not have any argument. Unlike normal functions, it doesn’t return any value. Has same name as that of [...]

Continue reading →

Why do we need constructors in C++

Prior to C++ programming or Object oriented programming; procedural languages such as C language were used. Procedural language program have typical structure where variables needs to be declared to hold data and functions need to be declared to operate on these variables. To share variables among various parts of program (or with number of functions) [...]

Continue reading →

Where does C++ program data stored

Every C++ program has some defined Input, Processing and desired Output.  C++ program contains Data and Operations to operate on data. If you see a memory structure of C++ Program, while loading into the memory, Data Section and Code section is created. But data section is not the only place where program data is stored [...]

Continue reading →

C++ and Win32 Exceptions

What is an exception? Exception is the special condition that changes the flow of normal execution . Some times te exceptions may endf up crashing the appln ,but it can usually be handled using the catch block in the code.     Basically there are two typpes of exception ,one is the h/w exception & [...]

Continue reading →

Problems with C++ assignment operator

Assignment Operator is invoked in following scenarios, where one existing or already constructed object assigned to another constructed object. class MyClass  { int  nSize; char  *szName ; }; MyClass myObj1; MyClass myObj2; myObj1 = myObj2;   // Assignment Operator By default Compiler provides a Assignment operator which will do following operation on assigning myObj2 to myObj1. [...]

Continue reading →

C C++ declaration and definition examples

  Declaration means informing the compiler that you have created a particular type of symbol that is being used by your program. Note: this is just an symbol or name that will be inserted into symbol table during compilation pass. No Memory allocates.   Declaration:   int i;               // Variable declaration or object declaration extern [...]

Continue reading →

C, C++ entry point function main

For every C, C++ Program there is a entry point function, where program execution starts. Essentially Operating system looks for this function fro where program can be executed. This entry function  is ” main” Default code looks like given below int main ( int argc,  char *argv[]) { return 0; } So this function returns [...]

Continue reading →

C++ compile time and runtime polymorphism

C++ Polymorphism “Same thing behaving differently in different scenario’s.”  What does this mean in programming parlance?  Same object behaving differently (execute different code) at runtime based on some runtime values. For example a Shape object may draw a Circle, Rectangle or Triangle at runtime based some values. This is one of the core concepts of [...]

Continue reading →