Subject:
|
RE: Two dimensional arrays in NXC
|
Newsgroups:
|
lugnet.robotics.nxt
|
Date:
|
Sun, 30 Mar 2008 01:55:40 GMT
|
Reply-To:
|
<DICKSWAN@SBCGLOBALnospam.NET>
|
Viewed:
|
31872 times
|
| |
| |
As an alternative, you might want to look at the ROBOTC solution. It fully
supports two dimensional arrays. You can download a 30-day evaluation
version from www.robotc.net. It's best to use the pre-release version (1.22
or higher) if you'll be working with "byte" or "char" arrays.
-----Original Message-----
From: news-gateway@lugnet.com [mailto:news-gateway@lugnet.com] On Behalf Of
Trevyn Watson
Sent: Friday, March 28, 2008 10:38 PM
To: lugnet.robotics.nxt@lugnet.com
Subject: Two dimensional arrays in NXC
Hello,
I'm trying to use two dimensional arrays in NXC, like this:
int onedarray[4];
int twodarray[4][4];
task main()
{
onedarray[2] = 1;
twodarray[2][2] = 1;
}
I read that the stock firmware doesn't support them, so I got John
Hansen's enhanced firmware and put it on my NXT. I downloaded the latest
version of BricxCC, and found and checked the "Enhanced firmware"
checkbox in the preferences. The code still won't compile. I get
line 7: Error: '=' expected
line 7: Error: Identifier expected
line 7: Error: Undefined Identifier 2
line 7: Error: Datatypes are not compatible
line 7: Error: ';' expected
Am I doing something wrong?
How can I use multidimensional arrays?
Thanks,
Trevyn
|
|
Message has 1 Reply:
Message is in Reply To:
| | Two dimensional arrays in NXC
|
| Hello, I'm trying to use two dimensional arrays in NXC, like this: int onedarray[4]; int twodarray[4][4]; task main() { onedarray[2] = 1; twodarray[2][2] = 1; } I read that the stock firmware doesn't support them, so I got John Hansen's enhanced (...) (17 years ago, 29-Mar-08, to lugnet.robotics.nxt)
|
9 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|