布尔国际 [英] bool int

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

问题描述



难道我不能这样做:


if(1)++ count;


如果(1 == 1)++ count;



Texeme
http://texeme.com

推荐答案

Elementary Penguin写道:
Elementary Penguin wrote:

我不能这样做:

如果(1)++ count;

如果(1 == 1)++ count;

Shouldn''t I be able to do this:

if(1) ++count;

it seems really a pain to have to do

if(1==1) ++count;




i guess因为c#强类型



i guess because c# is strongly typed


或者......


如果(真)++计数;


....无论如何,这可以说是一个数量级更可读。

Afterall,我是仍然不确定你是否写了1号或字母l。


Brian


小学企鹅写道:
Or...

if (true) ++count;

....which is arguably an order of magnitude more readable anyway.
Afterall, I''m still not sure if you wrote the number 1 or the letter l.

Brian

Elementary Penguin wrote:
不应该我能够做到这一点:

如果(1)++ count;

这似乎真的很痛苦

if(1 == 1)++ count;

-
Texeme
http://texeme.com
Shouldn''t I be able to do this:

if(1) ++count;

it seems really a pain to have to do

if(1==1) ++count;

--
Texeme
http://texeme.com






哎呀,你必须是像我这样的前C黑客!


C是为数不多的几种语言之一。你在

也不能在Pascal中做到这一点!


C#是强类型的:布尔和整数是不同的东西。我好b $ b喜欢它,但那只是我。 :)

Gee, you must be an ex-C hack like me!

C was one of the few languages that got ints and bools confused. You
couldn''t do that in Pascal, either!

C# is strongly typed: booleans and integers are different things. I
prefer it, but that''s just me. :)


这篇关于布尔国际的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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