[ros-dev] Uninitialized static variable in function

Dmitry Gorbachev d.g.gorbachev at gmail.com
Sun Mar 20 16:23:23 UTC 2011


>> > teachers at college told us it is a must to initialize variables.....
>>
>> When I was in high school, our teacher told me that a simple "int
>> a[5];" (without "= {0};") would initialize the array with zeroes. But
>> it didn't. At least, in old good Borland C/C++ 3.1.
>
> ....so, depends on compiler

Global, and local static variables are initialized; local non-static
variables are not. I have no Borland compiler at hand, but I bet it
conforms to the standard!



More information about the Ros-dev mailing list