View unanswered posts | View active topics It is currently Mon Jul 28, 2014 12:57 am






Reply to topic  [ 3 posts ] 
Array Problem - PLEASE HELP 
Author Message
Rookie

Joined: Fri Mar 16, 2007 10:24 pm
Posts: 2
Post Array Problem - PLEASE HELP
Could somebody give me an example of a working (and tested in robotc) set of nested loops that will initialize a 2 dimensional array of characters to any particular character (say 'X').

I'm an experienced programmer, and simply cant get this to work as it would in c. Maybe a syntax issue...maybe a brain cramp...but PLEASE HELP!!

Thanks


Sun Mar 18, 2007 4:30 pm
Profile
Rookie

Joined: Fri Mar 16, 2007 9:12 am
Posts: 26
Post 
Hey, can you post your code that doesn't work for this? I'm just curious as to whether it's a syntax problem. I'll look at this for a few minutes tomorrow to see if I can get anything afterwards.


Tue Mar 20, 2007 11:33 pm
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 614
Post 
Try this. It compiles fine. [BUt I'm using early access to version 1.03.

{
int index1;
int index2;

char doubleArray4[3][4];

for (index1 = 0; index1 < 3; ++index1)
{
for (index2 = 0; index2 < 4; ++index2)
doubleArray4[index1][index2] = 'X';
}
return;
}

There has been significant changes to char support between 1.01 and 1.03 n that early version stored char array in 16-bit words and new version uses byte value. However, this change should be end-user transparent.


Fri Mar 23, 2007 10:59 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.