Friend Function in C++

Image
Friend Function in C++ Welcome to C++ Programming. In this article, we will talk about friend Function and friend Class trying to understand what do they mean and why are they useful in C++ design process. These will be the module outline we will take examples of Matrix Vector Multiplication and Linked List, and finally will end with somenotes. As you know as usual the outline will be available on the left of your slide So, let us first introduce the basic notion of friend function. On the left you have the view of ordinary function. So the situation is like this, that I have a class myclass which as some private data, it has a constructor, and it has; I am sorry if just ignore this line. I have this function written outside of this class which is trying to do something with the class. What is it doing? It takes an object of the class by reference parameter call by reference, and then it tries to print the data element component of that objective. Now, what do we know, this is pr...

Constructor C++

Constructor C++

                        Constructor is used to initailize the data members automatically.A constructor is a member function of class.It execute when object of that class created.It means that when object of class created the constructor executes automatically.By default there is constructor even if you dont write it.


 Constructor Syntax 

                         The syntax of constructor is like same name of class e.g if the name of class is A so the constuctor will start with A(){ here is the body }.


Copy Constructor C++

                   Just read about copy constructor and assignment operator they can create a big problem in real world projects they cannot be used but for you should have some knowledge about it.

Constructor C++

Comments

Popular posts from this blog

Friend Function in C++

Programming language in C++

How To Use Class and Object In C++