标签:style code ios delete names return cout main turn
#include <iostream> using namespace std; double* aaa() { double tmp[3] = { 1.01,2.02,3.03 }; double* tmp1 = new double[3]; for (size_t i = 0; i < 3; i++) tmp1[i] = tmp[i]; return tmp1; } int main() { double* a = new double[3]; a = aaa(); for (size_t i = 0; i < 3; i++) { cout << *(a + i) << endl; } delete[]a; system("pause"); }
运行结果:
1.01
2.02
3.03
请按任意键继续. . .
标签:style code ios delete names return cout main turn
原文地址:https://www.cnblogs.com/liuxiaoqing1/p/14877747.html