标题:我这三目运算为啥不行?
只看楼主
Sillydog
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2018-4-19
得分:0 
回复 8楼 lin5161678
哦哦,多谢指教
2018-06-21 08:19
星泪成寒
Rank: 7Rank: 7Rank: 7
等 级:黑侠
威 望:6
帖 子:75
专家分:539
注 册:2013-5-19
得分:4 
C语言标准定义 6.5.15 Conditional operator后2个表达式结果是同样(或兼容)的类型(包含void).
程序代码:
One of the following shall hold for the second and third operands:
— both operands have arithmetic type;
— both operands have the same structure or union type;
— both operands have void type;
— both operands are pointers to qualified or unqualified versions of compatible types;
— one operand is a pointer and the other is a null pointer constant; or
— one operand is a pointer to an object type and the other is a pointer to a qualified or unqualified version of void.


2018-06-21 09:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-488042-1-1.html




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

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