C++面向对象程序设计 003:好怪异的返回值 ----(北大Mooc)

文章目录


原题题目

在这里插入图片描述

#include <iostream>
using namespace std;

//此处填写 getElement(int * a, int i)
{
    
    
	return a[i];
}
int main()
{
    
    
	int a[] = {
    
    1,2,3};
	getElement(a,1) = 10;
	cout << a[1] ;
	return 0;
}


代码实现

int &

猜你喜欢

转载自blog.csdn.net/qq_37500516/article/details/114685147
今日推荐