| | |
this pointer
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 48
Reputation:
Solved Threads: 0
Hello guys,
I'm very green in c++ and just started to understand classes and objects. I'm reading on the web about this pointer, but having difficulties understanding how it works exactly, could aanybody please help me understand or reference a good article for total noobs in c++ to grasp the this concept in simple explanation? would be greatly appreciated.
thank you
andre
I'm very green in c++ and just started to understand classes and objects. I'm reading on the web about this pointer, but having difficulties understanding how it works exactly, could aanybody please help me understand or reference a good article for total noobs in c++ to grasp the this concept in simple explanation? would be greatly appreciated.
thank you
andre
Look body, the pointer is a main axis in C Language -the person who understand these pointer is the person who is well understanding the programming concepts. Get Data Structure Books which takes its steps in the pointer way -Stacks, queues, lists, and tree in the array implementation and the linked one.
That what I have!
Good Luck...
That what I have!
Good Luck...
this pointer has its own use:
first of all if you are dealing in a big project, you may use the convention this-member to differentiate between the member of the same global identifiers.
Moreover, it increases the readability of the code.
Secondly, you may like to use it if u do operator overloading for your class, like when you are overloading the assignment operator, you could return the this pointer itself.
But then, it is a fact that pointer do mess things up. moreover, C++ STL provide you with all those things you will hardly need to know about pointers.
This is what encapsulation is. And thats why OOP rocks.
But then, understanding pointers have its own merits. So I prefer that you should probably read about it surely.
first of all if you are dealing in a big project, you may use the convention this-member to differentiate between the member of the same global identifiers.
Moreover, it increases the readability of the code.
Secondly, you may like to use it if u do operator overloading for your class, like when you are overloading the assignment operator, you could return the this pointer itself.
But then, it is a fact that pointer do mess things up. moreover, C++ STL provide you with all those things you will hardly need to know about pointers.
This is what encapsulation is. And thats why OOP rocks.
But then, understanding pointers have its own merits. So I prefer that you should probably read about it surely.
![]() |
Similar Threads
- *Pointer program problem. (C++)
- How to access a Public Pointer value of a class directly? (C++)
- pointer to member? (C++)
- pointer to some code (C++)
- pointer (C)
- Assign content to a function pointer (C)
- Change Out Your Pointer Scheme (Windows tips 'n' tweaks)
Other Threads in the C++ Forum
- Previous Thread: program with padding a string.
- Next Thread: PRIME number in an array
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets







..