Hi everybody, i am new to c++ and wanna know why pointers are useful ? Why would i use them ? For what ?
THANKS

Recommended Answers

Read this: http://www.cplusplus.com/articles/EN3hAqkS/

and then this: http://www.cplusplus.com/articles/z186b7Xj/

and then if you still don't se any use for them, come back and ask again.

Jump to Post

All 4 Replies

I don't want to be rude, but at least take the time to search the forum, there are dozens of threads about pointers and reference. Or google it, you will find tons of pages related to this topic. Btw, did you know, you can find C++ lectures from Stanford on youtube?

Ok thanks !

Pointer to item == address of item in program space. A C++ reference is, under the covers, a pointer. You can pass the pointer to an object to a function, which if not specified as const, will allow the function to modify the object. This would be necessary if the function is a C function. If it is a C++ function, then it is safer to pass as a reference. Read more - this stuff is fundamental to understanding and writing good/safe C and C++ code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.