#include <iostream>
using namespace std;
int* returndie() // 除了地址为a的,a以后的都死了
{
int a[4] = { 1, 2, 3, 4 };
return a;
}
int main()
{
auto a = returndie();
for (size_t i = 0; i < 4; i++)
{
cout << a[i] << ‘ ‘;
}
getchar();
return 0;
}
output:
1 4061784 1940440 1911712
时间: 2024-10-22 03:21:31