Page 1 of 1
RCX NQC variable types
Posted: 28 Oct 2010, 02:58
by mattallen37
What different types of variables are available in NQC? I know "int" is, but that seems to be the only one. Is it?
Re: RCX NQC variable types
Posted: 28 Oct 2010, 15:04
by afanofosc
The RCX firmware supports only one variable type so NQC only gives you one type. 16 bit signed integers using the "int" keyword. You do have access also to arrays of int and int pointers if you use the RCX 2.0 firmware and the latest NQC compiler.
John Hansen
Re: RCX NQC variable types
Posted: 31 Oct 2010, 00:23
by mattallen37
Ok, that is what I suspected. Thanks. What are int pointers?
Matt
Re: RCX NQC variable types
Posted: 31 Oct 2010, 07:16
by mightor
Int pointers are pointers to ints
Basically, instead of a memory location holding a value like "100", it holds the value of a memory location of another variable. Everything you wanted to know about pointers but were afraid to ask:
http://pw1.netcom.com/~tjensen/ptr/pointers.htm
- Xander
Re: RCX NQC variable types
Posted: 31 Oct 2010, 16:04
by mattallen37
Ok, I think I understand now. Thanks.
Re: RCX NQC variable types
Posted: 31 Oct 2010, 17:13
by mightor
Pointers are an awesome way of messing up your program in fantastic and unpredictable ways that are almost impossible to debug.
- Xander
Re: RCX NQC variable types
Posted: 31 Oct 2010, 19:00
by mattallen37
LOL. I can see that in theory, that could be very true.