cpp_prac/junk/2.cc
2025-01-11 17:54:29 +01:00

17 lines
299 B
C++

#include <cstdlib>
#include <iostream>
void consume_number(int *p) {
std::cout << "Consuming: " << *p << std::endl;
delete p;
}
void random_int(int &out) { out = rand(); }
void use2() {
int i;
random_int(i);
consume_number(&i);
}
int main(int argc, char *argv[]) { use2(); }