Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/08/11 12:54
Read: times


 
#182815 - Variable Initialisation
Hi all

A question about my compiler (Raisonance), I just noticed it when I was cleaning up a bit of code.

I have always been in the habit of explicitly initialising my variables when I define them

ie
char result = 0;

however if I define it as

char result;
result = 0;


it uses 3 bytes less of code space. It makes no difference what the value of the init is. why is this? is is a compiler flag that I should turn on, or should I change my habits.

Regards
Marshall







List of 8 messages in thread
TopicAuthorDate
Variable Initialisation            01/01/70 00:00      
   a question for (the) Raisonance (forum)            01/01/70 00:00      
      Depends on amounts of global data            01/01/70 00:00      
      Yes - Ask Raisonance!            01/01/70 00:00      
   Personal Preference Here            01/01/70 00:00      
      Another personal preference            01/01/70 00:00      
         My code based assignments are...            01/01/70 00:00      
            OO classes            01/01/70 00:00      

Back to Subject List