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

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -