If I don\'t assign a value to a variable when I declare it, does it default to zero or just whatever was previously in the memory?
e.g.
float x;
It depends. If this is a local variable (an object with automatic storage duration) it will be uninitialized, if it is a global variable (an object with static storage duration) it will be zero initialized. Check also this answer.