Add time using structures in C++

Write a program having a structure named Time which has three integer data items i.e. hour, minute and second. The task is to add the variables of the Time data type though a function

void AddTime(Time *time1, Time *time2)

which takes as arguments the addresses of two Time type variables, adds these variables and stores the result […]

By |C++ Source Code|0 Comments

Common Text Transformation Library

Common Text Transformation Library, CTTL for short, is a set of C++ classes and functions to understand and modify text data. The library implementation is based on STL classes and algorithms.

The library provides components for creating lexical analyzers making practical use of EBNF grammars. Template meta-programming and operator overloading offer features to write expressions that […]

By |C++ Source Code|0 Comments

Inheritance example

Simpler methods in the classes have been changed to inline code to shorten the file considerably. In a practical programming situation, methods that are this short should be programmed inline since the actual code to return a simple value is shorter than the code required to send a message to a non-inline method.

/*******************************************************
* […]

By |C++ Source Code|0 Comments

Function name overloading

An example of function name overloading within a C++ class. In this program the constructor is overloaded as well as one of the methods to illustrate what can be done in C++ programming language.

/*******************************************************
* MYCPLUS Sample Code – http://www.mycplus.com *
* […]

By |C++ Source Code|0 Comments

ballonpoking(A GAME IN C++)

This game will help all new C Language Programmers in understanding the concepts of graphics and object oriented programming in C++. So play and enjoy…………

Please post your comments and rate the game. Regards
Ehsan ul haq
/*******************************************************
* MYCPLUS Sample Code – http://www.mycplus.com *
* […]

By |C++ Source Code|2 Comments

Demonstration of inheritance in C++

Demonstration of inheritance in c++. This example contains the following files.

VEHICLE.H
VEHICLE.CPP
ALLVEHIC.CPP
CAR.H
CAR.CPP
TRANSPORT.CPP
TRUCK.H
TRUCK.CPP

Vehicle.h is a basic class for a vehicle. Car, truck and allvehicle will be inherited from this base class. All the common features of a vehicle are kept in the base class i.e weight, # of wheels etc…

Derived classes will have the veicle properties and […]

By |C++ Source Code|0 Comments

Design patterns

“describe a problem which occurs over and over again in our environment, and then describe the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice” – Christopher AlexanderThis source code introduces the important and yet […]

By |C++ Source Code|0 Comments

Using Templates to implement Stack

Using Templates to implement Stack

By |C++ Source Code|0 Comments