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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -