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 / 1834
1833  |  1835
Subject: 
c++, sensor declaration
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 10 Apr 2001 08:36:53 GMT
Viewed: 
1479 times
  
Hallo!

I tried to declare sensors global, out of main():

Motor motor(Motor::B);
LightSensor s(LightSensor::S3,false);

int main(){

...
}

make reports an error:

/home/micha/legOS/util/makelx test.ds1 test.ds2 test.lx
test.ds1: address out of bounds on line 311

If I declare the sensors within main(), it works.
Can someone tell me, why I can't declare sensors global? In c++ it
should be possible.

Best regards.
Michael



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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