Код: Выделить всё
#include
int* foo() {
int a = 5;
return &a;
}
int main() {
int* p = foo();
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79671996/why-does-the-returning-local-variables-address-in-c-not-crash-but-still-give[/url]
Мобильная версия