View unanswered posts | View active topics It is currently Fri Nov 16, 2018 11:45 am






Reply to topic  [ 1 post ] 
Passing arrays in robotc 3.65 
Author Message
Rookie

Joined: Sat Nov 29, 2014 4:51 am
Posts: 11
Post Passing arrays in robotc 3.65
I am attempting to pass an array of a struct to a function and assigning a variable to store it. However this has not been working (the secondary array struct is empty). Any help explaining this would be greatly appreciated.

Code:
struct {
  tMotor tmotor;
  int speed;
  int reversed;
} tMotorArray;


tMotorArray array2[3];// secondary struct

void test(tMotorArray array)
{
   array2=array;
}


task main()
{

tMotorArray array[3];

   array[0].tmotor=port1;
   array[0].speed=127;
   array[0].reversed=false;


test(array[3]);
}


Sat Nov 21, 2015 2:31 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

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.