To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1037
    local variables —Tobias Bende
   Hi! I read that legOS only declared varibles the first time the program is run. Does this mean I cannot use local variables. I have loops in different functions using 'i' as looping variable, which is locally declared. Should I avoid this? Tobias (24 years ago, 16-May-00, to lugnet.robotics.rcx.legos)
   
        Re: local variables —Michael Ash
   (...) I think you're confusing the issue a little bit. LegOS only initializes GLOBAL variables when the program is loaded. So, for example, a global variable declared like: int foo = 4; Will only be initialized to 4 when the program is loaded. If (...) (24 years ago, 17-May-00, to lugnet.robotics.rcx.legos)
   
        Re: local variables —Steven J. Morris
   (...) This is completely true and is basically a feature of the C language. Globals aren't technically "initialized" at all. They are just loaded as part of the image. You could consider that they are initialized at compile time. On a workstation OS (...) (24 years ago, 17-May-00, to lugnet.robotics.rcx.legos)
 

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR