| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 480 人关注过本帖
标题:【请教】C++中引用运用于结构,这个代码中定义的第三个函数怎么解释??
只看楼主 加入收藏
bxxue
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2012-9-5
结帖率:80%
收藏
已结贴  问题点数:10 回复次数:1 
【请教】C++中引用运用于结构,这个代码中定义的第三个函数怎么解释??
#include <iostream>
#include <string>
using namespace std;
struct free_throws
{
    string name;
    int made;
    int attempts;
    float percent;
};
void display (const free_throws & ft);
void set_pc (free_throws & ft);
free_throws & accumulate (free_throws & target,const free_throws & source);
请问  声明free_throws & accumulate (free_throws & target,const free_throws & source);这个函数时,free_throws & 中&在这的作用是什么,是代表返回值是引用么?我不用&似乎也可以???
搜索更多相关主题的帖子: display include percent source target 
2013-10-05 21:10
blueskiner
Rank: 8Rank: 8
等 级:蝙蝠侠
帖 子:227
专家分:707
注 册:2008-9-22
收藏
得分:10 
什么叫引用?就是变量的地址。不用引用的函数返回类或结构,就是返回一个拷贝。
2013-10-06 11:11
快速回复:【请教】C++中引用运用于结构,这个代码中定义的第三个函数怎么解释? ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014333 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved