0
I am studying C++ and I have doubts about this operator &, when should I use?
void funct(int *var) {
(*var)++;
}
void funct(int& var) {
var++;
}
These two function increments the varial, but I can’t tell the difference.
0
I am studying C++ and I have doubts about this operator &, when should I use?
void funct(int *var) {
(*var)++;
}
void funct(int& var) {
var++;
}
These two function increments the varial, but I can’t tell the difference.
Browser other questions tagged c++ pointer
You are not signed in. Login or sign up in order to post.
I think this answers http://answall.com/q/56470/101
– Maniero
In the example does not work in C, why?
– hugo
Because C doesn’t have pointer references.
– Maniero