int的初始值是多少? [英] What is the initial value of int

查看:189
本文介绍了int的初始值是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们声明一个字符串而不是给它一个值时,字符串的值是

null如:

string myString;


当我们声明一个像:

int myInt;


myInt的价值是多少?

When we declare a string, not giving it a value, the value of a string is
null like:
string myString;

When we declare a int like:
int myInt;

What is the value of myInt?

推荐答案

零(0),我认为。


" ad" < ad@wfes.tcc.edu.tw>在消息中写道

新闻:#v ************** @ TK2MSFTNGP14.phx.gbl ...
Zero (0), I think.

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:#v**************@TK2MSFTNGP14.phx.gbl...
当我们宣布一个字符串,没有给它一个值,字符串的值是
null像:
字符串myString;

当我们声明一个类似于:
int myInt;

myInt有什么价值?
When we declare a string, not giving it a value, the value of a string is
null like:
string myString;

When we declare a int like:
int myInt;

What is the value of myInt?



我不知道答案,但是难道你的代码不会失败

编译错误,CS0165:使用未分配的局部变量?

I don''t know the answer to that, but wouldn''t your code would fail to
compile with error, "CS0165: Use of unassigned local variable"?


它是零。

It is zero.


这篇关于int的初始值是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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