Efficient Programming: Saving System Resources in Your Program

Written by Raza. Posted in C++

Efficient Programming Techniques

Programming is not a Big Deal. The Big Deal is Efficient Programming. Efficient programming is a very comprehensive term which includes writing a code which uses as less system resources as possible, is free from most of the errors  and is capable of handling all kinds of situations. I shall show you first a piece of code and then explain to you some of these aspects for writing an efficient code. Kindly follow the following piece of code. 

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 .