S
sivashankar21
how i can improve my programming skill in pointer using c++
how i can improve my programming skill in pointer using c++
how i can improve my programming skill in pointer using c++
loufoque said:(e-mail address removed) a écrit :
You shouldn't even use pointers.
Avoid them as much as possible and only use them when it's needed.
But he may have developed sufficient skill in in avoiding them so heDefault said:loufoque wrote:
At which point he won't know how to use them.
Are there any (real world) instances where pointers can't be avoided?
Gianni said:Ian Collins wrote:
....
Let's see:
a) the "this" keyword.
b) When you may or may not want to pass an interface ... e.g.
void DoThing( const A & a, ErrorReporter * e = 0 );
c) Intrusive reference counted objects.
d) When objects point to one another i.e. a<->b
+ many more
With the exception of a, all these can be replace by some form of smart
pointer object.
True enough, but I was trying to think of an example where raw pointersGianni said:Ian Collins wrote:
....
You still need to understand pointers even if you're managing them using
smart pointers.
can't be replaced with smart pointers.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.