105 Posted Topics

Member Avatar for comwizz

[COLOR=#0000ff]The stack is a lifo(last in first out) based sequential structure. I think you don't need a double link list to implment it, you can implement lifo based list directly. [code] struct Node { int m_iVal; Node* m_pNext; Node(int const& iVal,m_pNext=0) } [/code] if you've used the stack it provides …

Member Avatar for Lerner
0
4K
Member Avatar for chillharsh

Swapping two variables is an easy stuff if you are using temporary variable [code] void swap(int& a,int& b) { int temp=a; a=b; b=temp; } //in C++ template template<typename _Type> void swap(_Type& t, _Type& t2) { _Type temp=t; t=t2; t2=temp; } [/code] using only the two variables requires a little maths. …

Member Avatar for sukhi
0
480
Member Avatar for Laiq Ahmed

I've gone through several books they explain Upcasting as Base class pointer pointing to Drived class Object this definition is correct. Downcasting: [quote]Drived class pointer pointing to base class object..[/quote] i got a bit confused.....not having crystal clear image in my mind..... if the above definition is correct... whats wrong …

Member Avatar for Dave Sinkula
0
182
Member Avatar for joydeep1

Editing is a trick in File based databases.........you can use several ways to achieve this.... 1. Use the array of Structure and read the entire file in array of structure.......... and do all the work with that array and write the array back to the file........................ its not effecient. as …

Member Avatar for ~s.o.s~
0
109
Member Avatar for jitterson

Inheritance simply means Reusing the Interface of the base class. Two classes have something in common for example consider the following example. There are two classess Shape(a base/parent class) and Circle(a derived/child class ) you might have guessed there is some relationship between shape and Circle. Every shape has color …

Member Avatar for jitterson
0
104

The End.