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

Solve the Quadratic equation using C++

This program will solve quadratic equations.
You can copy and paste it into an editor, save it and compile from there.I have compiled and run this on a RedHat GNU/Linux machine using kernel 2.4.20-6 and it works. If you are using another system ( windows or mac you may need to change the coding ).
To compile: […]

By |C++ Source Code|0 Comments

Phil Sykes

This is a class which has a member function that takes 3 arguements – std::string thestlstring, int base, and int base2. the function converts a number stored in the form of an std::string from the first base to the second. Bases 2 – 16 are supported.

massiveattack92(at)hotmail.com/*******************************************************
* MYCPLUS Sample Code – http://www.mycplus.com […]

By |C++ Source Code|0 Comments

Flexible Vector and Matrix (Vectors and Matrix with Arbitrary Bounds)

Here is Flexible Vector and Matrix (Vectors and Matrix with Arbitrary Bounds). The algorithm has been written by Alex Vinokur. Programming Language : C++. Any and all comments would be appreciated.

By |C++ Source Code|0 Comments

Multiple inheritance

In order to keep the program as simple as possible, all of the member methods are defined as inline functions.? This puts the code for the methods where it is easy to find and study.? You will also notice that all variables in both classes are declared to be protected so they will be readily […]

By |C++ Source Code|0 Comments