如果一个); [英] if(a);

查看:60
本文介绍了如果一个);的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if(a);


在此代码中,使用if语句将变量a转换为a。

comparizon?

if(a);

In this code, towhat type does the if statement cast the variable "a" to on
comparizon?

推荐答案

2004年5月10日星期一23:06:40 + 0200,在comp。 lang.c,Martin Johansen

< ma ****** @ is.online.no>写道:
On Mon, 10 May 2004 23:06:40 +0200, in comp.lang.c , "Martin Johansen"
<ma******@is.online.no> wrote:
if(a);

在这段代码中,towhat类型使if语句强制转换变量a;比较
比较?
if(a);

In this code, towhat type does the if statement cast the variable "a" to on
comparizon?




a不适用于任何类型。演员是当程序员故意输入额外的东西时,例如

(sometype)foo;

将foo转换为sometype对象。


回到原来的问题:''a''必须是一个整体类型,或者

可以转换为整数类型的东西。


-

Mark McIntyre

CLC FAQ< http://www.eskimo.com/~scs/C-faq/top .html>

CLC自述文件:< http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>

---- ==发表于Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News == ----
http:/ /www.newsfeed.com 世界排名第一的新闻组服务! > 100,000新闻组

--- = 19东/西海岸专业服务器 - 通过加密的总隐私= ---



a isn''t cast to any type. A cast is when the programmer deliberately types
extra stuff eg
(sometype) foo;
casts foo to a sometype object.

Back to your original question: ''a'' has to be an integral type, or
something that can be converted to an integral type.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


Martin Johansen写道:
Martin Johansen wrote:

if(a);

在这段代码中,使用if语句将变量a转换为a。比较
比较?

if(a);

In this code, towhat type does the if statement cast the variable "a" to on
comparizon?




无:代码不包含任何演员。


-
Er*********@sun.com


Mark McIntyre< ma ********** @ spamcop.net>写道:
Mark McIntyre <ma**********@spamcop.net> writes:
2004年5月10日星期一23:06:40 +0200,comp.lang.c,Martin Johansen
< ma *** ***@is.online.no>写道:
On Mon, 10 May 2004 23:06:40 +0200, in comp.lang.c , "Martin Johansen"
<ma******@is.online.no> wrote:
if(a);

在这段代码中,towhat类型使if语句强制转换变量a;比较
比较?
if(a);

In this code, towhat type does the if statement cast the variable "a" to on
comparizon?



回到原来的问题:''a''必须是一个整体类型,或者
可以转换为积分类型。



Back to your original question: ''a'' has to be an integral type, or
something that can be converted to an integral type.




不,它只需要有标量类型。标量类型是

算术类型(整数或浮点类型)或

指针类型。


6.8.4.1 if语句

约束

1 if语句的控制表达式应具有标量类型。


- -

我在我的DeathStation 9000上跑了它,恶魔飞出了我的鼻子。 --Kaz



No, it only has to have scalar type. A scalar type is an
arithmetic type (either an integer or a floating-point type) or a
pointer type.

6.8.4.1 The if statement
Constraints
1 The controlling expression of an if statement shall have scalar type.

--
"I ran it on my DeathStation 9000 and demons flew out of my nose." --Kaz


这篇关于如果一个);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆