title: How to pass struct attributes as arguments
body: <p>I'm trying to pass struct parts to functions, is this possible?
  I want to create general functions like the <code>setLeftMotorSpeed</code> below and pass them anything i want, in this case i need to set the <code>robot.leftMotorSpeed</code> via a pointer</p>
  
  <p>Example:</p>
  
  <pre><code>typedef struct
  {
      int maximumSpeed;
      int leftMotorSpeed;
      int rightMotorSpeed;
      int timesAboveMaximumSpeed;
      int batteryLevel;
      int collisions;
  
  }robot;
  
  void setLeftMotorSpeed(int *speed, int *leftMotorSpeed, int *rightMotorSpeed)
  {
      *leftMotorSpeed = *speed;
  }
  
  void chooseRequest(int *command, int *speed, robot RP6)
  {
      switch(*command)
      {
          case 1:
              setMaximumSpeed(speed, &amp;RP6.maximumSpeed);
              break;
          case 2:
              getMaximumSpeed(speed, &amp;RP6.maximumSpeed);
              break;
          case 3:
              setLeftMotorSpeed(speed, &amp;RP6.leftMotorSpeed, &amp;RP6.rightMotorSpeed);
              moveAtSpeed(RP6.leftMotorSpeed, RP6.rightMotorSpeed);       
              break;
          case 4:
              setRightMotorSpeed(speed, &amp;RP6.leftMotorSpeed, &amp;RP6.rightMotorSpeed);
              moveAtSpeed(RP6.leftMotorSpeed, RP6.rightMotorSpeed);
              break;
          case 5:
              break;
          case 6:
              break;
          case 7:
              break;
          default:
              break;
      }
  }
  </code></pre>