title: typedef'ing an array vs. using a struct in C++
body: <p>Found an interesting use of a typedef that I really didn't see the need for.</p>
  
  <pre><code>typedef int Color[3];
  </code></pre>
  
  <p>So then the use would be:</p>
  
  <pre><code>Color pants;
  pants[0] = 0;
  etc.
  </code></pre>
  
  <p>Using the typedef through ptrs was creating strange looking code that wasn't clear.</p>
  
  <p>Why not just use a struct?</p>
  
  <pre><code>struct Color {
  int r;
  int g;
  int b;
  };
  
  Color pants;
  pants.r = 0;
  etc.
  </code></pre>
  
  <p>You could use a union to express the vars as an array or individually, which is wonky, but still clear that it is somehow more complex than a single value.</p>
  
  <p>Can someone offer insight as to the merit of using the typedef'd array vs. struct?</p>