title: checking my understanding of pointers/structures and arrays
body: <p>Hey all I'm just trying to understand a few key concepts, and have done my own research but have a few questions and would really appreciate it if someone could check to see if they're correct. I'm doing a review for a test, and our professor told us to figure it out ourselves...so i did and here it goes :)</p>
  
  <p><strong>1: declare a pointer called thePointer to hold the address of an element from an array with 10 elements called Pointed</strong></p>
  
  <pre><code>int Pointed[10] = {};
  
  int *thePointer = &amp;Pointed[1];
  </code></pre>
  
  <p>Need help with this one...</p>
  
  <p><strong>2: write a function that will accept the address of an array and number of elements in an array and use information to initialize each element of array to zero</strong></p>
  
  <pre><code>void arrayFunction (int *array, int element)
  
      for (x = 0; x &lt; element; x++);
        {
        array[x] = 0;
        }
  </code></pre>
  
  <p><strong>3: create a structure that holds bits representing the following</strong></p>
  
  <p><strong>--2 fields that each hold 4bit BCD digits, together they hold current rotation count (i called them CRC1 and CRC2)
  motor direction: 2 bits
  speed: 4 bits
  fault condition: 3 bits
  Name the structure controlMotor</strong></p>
  
  <pre><code>struct controlMotor{
  
  unsigned char CRC1: 4;
  unsigned char CRC2: 4;
  unsigned int motorDirection: 2;
  unsigned int speed: 4;
  unsigned int faultCondition: 3;
  };
  </code></pre>
  
  <p><strong>-- use typedef to name this new data type: statusDrive_t</strong></p>
  
  <pre><code>typedef controlMotor statusDrive_t;
  </code></pre>
  
  <p><strong>--create array of structure named marsDrive to hold status of each 6 drives</strong></p>
  
  <pre><code>statusDrive_t marsDrive[5] ={statusDrive_t.CRC1,statusDrive_t.CRC2,statusDrive_t.motorDirection,statusDrive_t.speed,statusDrive_t.faultCondition}
  </code></pre>
  
  <p><strong>initialize each field of the first element of array with maximum value</strong></p>
  
  <pre><code>marsDrive[0].CRC1 = 15;
  marsDrive[0].CRC2 = 15;
  </code></pre>