| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 377 人关注过本帖
标题:新人求教 大婶解答 万分感谢
只看楼主 加入收藏
柠檬123
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-9-25
结帖率:0
收藏
已结贴  问题点数:20 回复次数:5 
新人求教 大婶解答 万分感谢
在c语言的位运算中,在不引入参数的前提下交换ab的值的编程中:
int a,b;
a^=b^=a^=b;
请问这是什么意思?谢谢各位照顾新人
搜索更多相关主题的帖子: c语言 
2014-09-25 21:02
muyoucumian
Rank: 3Rank: 3
等 级:等待验证会员
帖 子:80
专家分:126
注 册:2014-8-30
收藏
得分:7 
大婶是谁啊?
2014-09-25 21:03
柠檬123
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-9-25
收藏
得分:0 
回复 2 楼 muyoucumian
是你 是大神 我打错字了,你能帮我看看吗
2014-09-25 21:05
柠檬123
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-9-25
收藏
得分:0 
回复 3 楼 柠檬 123
有人在吗
2014-09-25 21:12
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:7 
未定义行为

序列点 Sequence points
在相邻的两个序列点之间,一个对象只允许被修改一次,而且如果一个对象被修改则在这两个序列点之间只能为了确定该对象的新值而读一次。
C99(ISO/IEC 9899:201x)规定的序列点
The following are the sequence points described in 5.1.2.3:
—The call to a function, after the arguments have been evaluated (6.5.2.2).
—The end of the first operand of the following operators: logical AND && (6.5.13); logical OR || (6.5.14); conditional ? (6.5.15); comma , (6.5.17).
—The end of a full declarator: declarators (6.7.5);
—The end of a full expression:
  an initializer (6.7.8);
  the expression in an expression statement (6.8.3);
  the controlling expression of a selection statement (if or switch)(6.8.4);
  the controlling expression of a while or do statement (6.8.5); each of the expressions of a for statement (6.8.5.3);
  the expression in a return statement(6.8.6.4).
—Immediately before a library function returns (7.1.4).
—After the actions associated with each formatted input/output function con version specifier (7.19.6, 7.24.2).
—Immediately before and immediately after each call to a comparison function, and also between anycall to a comparison function and anymovement of the objects passed as arguments to that call (7.20.5).
2014-09-26 09:39
fl8962
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:14
帖 子:539
专家分:2471
注 册:2012-10-17
收藏
得分:7 
回复 楼主 柠檬 123
a^=b^=a^=b;
1: a=a^b;
2: b=b^a;
3: a=a^b;
if( a=1;b=2)
 a^b=3;
 b=b^a=01;
 a=a^b=2;
a=2,b=1;

想抽苏烟了。
2014-09-26 10:24
快速回复:新人求教 大婶解答 万分感谢
数据加载中...
 
   



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

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