Menu

C++ Archive

Stack program in CPP using Class and Array

Stack Program in CPP A stack is like a standard C++ container adapter, It designed to be used in a LIFO (Last in First Out) context. That is implemented with an interface. Let’s learn through an example of the Stack program in CPP Stack code in CPP //A simple stack example: push, empty, pop and top   

How to create a program Generic bubble sort in C

Generic bubble sort in C Today we Learn about sorting technique in  C for example:- How to create a Generic Bubble sort in C. How to create a Generic Bubble Sorting in C    #include <iostream> using namespace std; template <class X> void bubble(X *data, intsize) { register inta, b; X t; for(a=1; a <

Example of Inheritance program in c++ with explanation

Inheritance program in c++ A simple example of the Inheritance program in c++ with output. And a full explanation of every statement. Example of inheritance program #include <iostream> using namespace std; class BaseClass { int i; public: void setInt(int n); int getInt(); }; class DerivedClass : public BaseClass { int j; public: void setJ(int n);
Learn For Free.