vb6 将静态 Integer 初始化为什么? [英] What does vb6 initialize a static Integer to?

查看:12
本文介绍了vb6 将静态 Integer 初始化为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Static i as integer

在我赋值之前,会是什么.

What will i be before I assign a value.

它似乎只是零 (0),但我想确认一下.

It seems to be just zero (0) but I wanted to confirm that.

推荐答案

根据微软

通常在 Visual Basic 中,当在 Function 或 Sub 过程中声明静态变量时,默认情况下它会初始化为 0(数字数据类型)或空字符串"(字符串数据类型).

Normally in Visual Basic, when a static variable is declared inside a Function or Sub procedure, it gets initialized to 0 (numeric data type) or an empty string, "" (string data type), by default.

是的,你可以确定它的默认值是零.

So yeah, you can be sure it's default value is zero.

希望对你有帮助

这篇关于vb6 将静态 Integer 初始化为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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