17 lines
299 B
C++
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(); }
|