vb6 将静态整数初始化为什么? [英] What does vb6 initialize a static Integer to?
本文介绍了vb6 将静态整数初始化为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Static i as integer
在我赋值之前i是什么.
它似乎只是零 (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 将静态整数初始化为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文