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