Pointers and functions on c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Pointers and functions on c++

Hey, i know, that its possible to use pointers on functions witouth using "return", so...how it look like????

24th Apr 2019, 7:44 AM
Սեդ
Սեդ - avatar
1 Answer
+ 4
void f(int *x) { ++*x } If you call it with the adress of a variable (like f(&var)), it gets changed directly from the function, so there's no need to return anything.
24th Apr 2019, 9:14 AM
HonFu
HonFu - avatar