What does vb6 initialize a static Integer to?

前端 未结 2 1007
死守一世寂寞
死守一世寂寞 2021-01-27 02:46
Static i as integer

What will i be before I assign a value.

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

2条回答
  •  日久生厌
    2021-01-27 03:09

    According to Microsoft

    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.

    Hope this helps

提交回复
热议问题