Posts Tagged ‘cprogramming’

Overloading Insertion Operator (<<)

Written by Raza. Posted in C++

inserting data in the computer

We have been discussing rather overloading various operators in the object oriented paradigm in the past. Overloading operators in our class is solely for our own benefit and effectiveness of the program. It saves us from writing lengthy complicated code over and over again. When we work with objects and there is an Array inside that object, we would certainly want to output it time and again. Instead of making a loop for that every time, we overload the insertion operator (<<) once and for all which is used to cout the data on our screen. Let us see how to do that. 

Overloading Error Free Assignment Operator

Written by Raza. Posted in C++

Overloading Assignment Operator in Object Oriented Paradigm

Assignment is not a simple task in object oriented programming. It may take you a day to trace out an error that is happening because of incorrect assignment, let alone fix it. In a post before, I dealt with some issues while assigning one object to another. Still there are some issues associated with it. So I shall write a code and explain to you its errors. Kindly Follow this piece of Code. 

Selection Sort using Recursion

Written by Raza. Posted in C++

recursive process in computer

As I mentioned earlier, this time instead of advancing towards another Sorting Algorithm, we would discuss the previous one, that is, the selection sort algorithm in the light of Recursion. So let’s deliberate over recursion first.

Usage of this Pointer in C++

Written by Hamza. Posted in C++

this pointer c++

Thus far in this series on object oriented programming in C , we have learnt the basics of classes and objects and have touched upon the private data members and public member functions, including use of getters and setters in C . When dealing with a class, we create different objects and call a number of functions on them. Have you ever wondered: How does the compiler know on which object the function was called and to change the variables of which object inside that function? This is done using this pointer in C .

Class Template Specialization in C++

Written by Raza. Posted in C++

Computer Programming Code in Object Oriented Paradigm

We have been discussing templates in detail for over two weeks. First we explored function templates with a single parameter, then with multiple parameters and also learnt how to specialize template functions.  Currently we are exploring class templates. Today we shall see how we can specialize class templates for a particular data type. They are specialized like function templates and behave identically as well but they are declared with a different syntax.