Linked Questions
50 questions linked to/from Why use pointers?
5 votes
11 answers
819 views
Why have pointer parameters? [duplicate]
Possible Duplicates: Why use pointers? Passing a modifiable parameter to c++ function Why would I want to have pointer parameters? The only reason I can see is for small functions to attempt to ...
0 votes
3 answers
1k views
Is it good practice to use pointers in every place possible? [duplicate]
Possible Duplicate: Why use pointers? I've just got the hang of pointers and now my practice is to actively look of occasions to use pointers, and use them in every possible situation I can ...
0 votes
3 answers
1k views
C++ address operator uses? [duplicate]
Possible Duplicate: Why use pointers? I know what the C++ & does. but what can it be used for?
-1 votes
2 answers
2k views
Why do we use pointer in C++? [duplicate]
As someone new to programing (C++) , I came across pointer which gave me a headache doing it as I never seen the point of using it. I tried to look at other answer on stack overflow but it was a bit ...
0 votes
1 answer
2k views
Why do we use pointers instead of local variables? [duplicate]
I don't understand the difference between using a pointer and using a normal variable. I'm learning linked lists in class so the use of pointers seems more straightforward since pointers are used to ...
-3 votes
1 answer
656 views
what is mean by *adj and how it is working [duplicate]
I started working with the C++ STL and I am learnimg about list. I know that in list<int> adj, adj is an object of list class in which int are stored. My doubt is, what is mean by *adj in list&...
1 vote
6 answers
313 views
C++ property declaration [duplicate]
I'm diving into C++ coming from the worlds of Objective-C and Java. Java gave me all the OOP knowledge I have and Objective-C taught me about manual memory management. While adapting to C++ is easy (...
-1 votes
2 answers
91 views
When is the dereferencing operator useful? [duplicate]
I am a newbie c-coder, so this probably has a very simple answer. I understand the function of pointers and the dereferencing operator, but I'm not sure when they're actually useful? Basic example: ...
0 votes
0 answers
106 views
Pointer in Object Oriented Programming C++ [duplicate]
I'm comming from "java-world" and now I want to start learning C++. I know in C++ objects are created like variables without the key word "new" which is used in java, but I have often seen in OOP code,...
0 votes
0 answers
57 views
When should you use pointers in C++? [duplicate]
I get that you need pointers for handling something that grows and shrinks dynamically. In instances where that isn't the case, to my understanding, you use pointers when: your object is too big to be ...
0 votes
0 answers
44 views
What are the benifits of using a point to an array in practical programming? [duplicate]
string (*add(string (*str)[10])) [10]; //function return a point to array of 10 string int main() { string s[10] = {"a","b","c","d","e","f","g","f","i","j"}; string (*str)[10] = &s; ...
427 votes
10 answers
354k views
Pointers in C: when to use the ampersand and the asterisk?
I'm just starting out with pointers, and I'm slightly confused. I know & means the address of a variable and that * can be used in front of a pointer variable to get the value of the object that ...
29 votes
12 answers
16k views
What is the point of pointers? [duplicate]
What is the point of pointers in C++ when I can just declare variables? When is it appropriate to use them?
48 votes
6 answers
35k views
C++ polymorphism without pointers
EDIT: A better title for this would be: polymorphism for large collections of objects without individual heap allocations. Suppose that I have a base class Animal with virtual functions and some ...
6 votes
8 answers
5k views
Why do certain C/C++ functions use pointers as parameters?
I'm coming from C# and I'm learning C++ (with this tutorial) so I have a relatively insubstantial amount of knowledge on memory, but the only use I see in pointers is "saving space" and iterating ...