Question:
How do I change variables using external functions in C/C++? Repl link:
#include <stdin.h>
void changeVar(int* ptr, int newValue) {
// somehow change the value of the variable that has the address of {ptr}
}
int main() {
int num = 0;
changeVar(&num, 32);
printf("%d\n", num); // should print `32`
}