A really small tutorial introducing the ‘for’ loop, good for C++ newbies and programming beginners. In this tutorial I expect you to have a little knowledge about programming, but to understand at least the C++ variables and other basic information. Like in any other programming language, loops are very useful for repeating tasks. For is […]
Size of Structures
In this programming tutorial we will see that 2 structures with the same elements but with different arrange of elements make a different size of structure. Look at these structures:struct st1{ bool b1; int i1; char c1; bool b2; int i2;}; struct st2{ bool b1; bool b2; char c1; int i1; int i2;}; st1 works the same as st2 in C/C++, but the size of these structures isdifferent, because of the size of the data packing. Look […]
Dissecting ‘Hello World’ in C++ .NET
The purpose of this tutorial is to give you an idea of the differences between C++ and C++ .NET. It is suitable for those who want to migrate from C++ to C++ .NET but also for those with no prior experience in programming. This tutorial is written with two types of readers in mind. The […]
Using header files in C++ .NET
This tutorial will show you how to work with C++ .NET headers (or includes). How to create a header file with a class in it, include the file in a typical .cpp file, set a variable and call a public function, both defined inside the header. So let’s see how it’s done. Create a new C++ […]
Calculate grade average with weights
This C++ program will calculate the average of 4 grades by using weight calculation. It will then display the average and give the user a chance to review the grades.
Palindrome Detector using C++
The palindrome detector application will first clean and analyze a string and then inform you whether or not it is a palindrome. This is probably one of the strangest applications I built because the requirements forced me to not make use of any header files except iostream. Thus, instead of using a string object to manipulate the palindrome, […]
Overloading Operators: Creating a Rational Class
This tutorial will teach you how to overload most of the operators available in C++, including arithmetic and comparison, in order to create a class that is able to calculate rational numbers. Probably one of the most interesting features of object oriented programming is the possibility to overload operators. This allows you to create your […]
Understanding C++ data types II
Part II of the small book that teaches you the C++ data types. Even if you have an IQ under 25 you will can understand and use the data types. In this part you will see an important aspect of data types… signed and unsigned.
Read file to output stream and return its state
This code will read a file and display its content to the output stream (console), while being on the lookout for errors.
Quicksort algorithm and character count
This C++ console application accepts a string as input and after storing them in a character array, sorts them alphabetically using the quicksort algorithm. It also counts the number of character occurences in the string.