[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ignore last post, C Programming question



Hi everyone!

Sorry for the accidental half written post before.
I have a small question for all of you C coders.

Lets say my main() looks like this:

        int main(){

                  {
                      int x = 0;
                      do_something_using_x
                  }

             DO_SOMTHING_ELSE....

           return 0;
        } // end of main

I understand that x is local to that particular segment. But when that segment terminates (and never used again) does x still exist? or is it destroyed/free-ed and given back to the system?

Sincerely,
Travis


--
By moral standard,  I reject the the pursuit of material wealth as the primary goal of living.