c++11 - Is it possible for a garbage value to be negative in an array in C++? -


consider:

int a[100]; 

is possible uninitialized value in a[i] (where 0 < < 100) negative?

yes, why wouldn't ? theses bits can , sign of integer msb (most significant bit). if bit 1, int considered negative.

i see little point of knowing though. can't rely on garbage data it's undefined behavior.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -