cpp_prac/junk/2.cc

20 lines
291 B
C++
Raw Normal View History

2025-01-10 08:15:31 +01:00
#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();
}