Answers for "do c++ ints neeed to be initlaized"

C++
0

do c++ ints neeed to be initlaized

tldr; Yes, or you risk getting a random number as the starting value.

For automatic variables:
Some compilers might do it but the standard does not require it. A conforming implementation could leave them to be uninitialized garbage values.

For static variables:
They must be initialized to zero unless explicitly initialized otherwise.
Posted by: Guest on May-20-2021

Browse Popular Code Answers by Language