Using getters in C++

Written by Hamza. Posted in C++

getters in C++

Now that we have had a look at setters in C++, let us move on the the use and concept of getters. Getters, or accessors, are often found alongside setters in a class, and are extremely vital in object oriented programming.

Class Templates in C++

Written by Raza. Posted in C++

Cloud Computing Technology

Just like function templates, we can also make and use class templates in our program. With the help of class templates, a whole class could be made generic. Each function declared within the class is a template function by default. Class templates behave much like the function templates though there is a lot more to be associated and understood with them. Class templates can also be specialized like specializing function templates. For this article, I would explain only how to make a simple class, a template class. 

Common C++ Mistakes Programmers Make

Written by Ali. Posted in C++

C language provides a very wide resource to interact with numbers and other data types to get our problem solved. During this interaction, one usually tends to run off ground and do silly yet serious mistakes that are most of the times unintentional. The mistakes can range from common declaration errors to some serious programming errors that cannot be recognized at the compile time but send the program crashing at runtime. This post is a series of some programming mistakes that can be identified as simple yet grave.

Use of Destructors in C++

Written by Hamza. Posted in C++

destructor

Now that we”ve had a look at the types and uses of constructors, let us move on to the concept and use of destructors in C . Destructors are important in object oriented programming, as they are called whenever the life of an object ends. To understand destructors, first we must know that when dealing with classes, we often encounter a situation where pointers are used. A class with a pointer/pointers as data members are usualy allocated memory in a constructor. As a simple example, let us use a class called “point”, with a redundant data member called int * ptr. 

Introduction to Classes in Object Oriented Programming C++

Written by Hamza. Posted in C++

classes in C++

You may recall i started a  series about the basics of object oriented programming in C++. This is the second article of the series. Here, I give you an introduction to classes in C++, explaining about the basic syntax and structure, giving an example to illustrate just how to instantiate and use an object after declaring a class.