Pointers and functions on c++ | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответ
+ 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