Groups
Groups
Sign in
Groups
Groups
西南交通大学开源社区邮件组
Conversations
Labels
About
Send feedback
Help
给函数赋值是什么意思
5 views
Skip to first unread message
谢晓阳
unread,
Mar 17, 2014, 4:36:29 AM
3/17/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to swjtu_op...@googlegroups.com
有俩成员函数是这个样子滴
char & position(int row,int col)
{return data[row * width + col];}
char position(int row,int col) const
{return data[row * width + col];}
又有这样的调用
position(i + row,j + col) = p.position(i,j);
这样做会改变 data 相应位置上的值,上面这行给函数赋值是什么意思。
28hua
unread,
Mar 17, 2014, 10:37:41 AM
3/17/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to swjtu_op...@googlegroups.com
汗,返回值是引用可以作为一个左值,像重载 [] 时一样
在 2014年3月17日星期一UTC+8下午4时36分29秒,28hua写道:
Reply all
Reply to author
Forward
0 new messages