![]() |
Function Chaining in C++ (Call more than one function in a sequence )
1) This Simple program explain one of the use of this pointer in C++.
2) With the help of "this" pointer you can call as many as functions in a sequence. 3) This procedure is called function chaining 4) In this program i have used three different function and through main i have called all these function in a sequence with the help of this pointer Code: Cpp
|
Re: Function Chaining in C++ (Call more than one function in a sequence )
You need to return a reference :eek:, otherwise you are doing a copy of the object :confused:.
Try to add the method: Code: CPP
Better shall be: :cool: Code: CPP
|
Re: Function Chaining in C++ (Call more than one function in a sequence )
Yes, You are right. Thanks for your suggestion and reply.
|
| All times are GMT +5.5. The time now is 07:35. |