title: C++ converting a mac id string into an array of uint8_t
body: <p>I want to read a mac id from command line and convert it to an array of <code>uint8_t</code> values to use it in a struct. I can not get it to work.  I have a vector of string for the mac id split about <code>:</code> and I want to use <code>stringstream</code> to convert them with no luck. What I am missing?</p>
  
  <pre><code>int parseHex(const string &amp;num){
    stringstream ss(num);
    ss &lt;&lt; std::hex;
    int n;
    ss &gt;&gt; n;  
    return n;
  }
  
  uint8_t tgt_mac[6] = {0, 0, 0, 0, 0, 0};
    v = StringSplit( mac , ":" );
    for( int j = 0 ; j &lt; v.size() ; j++ ){
      tgt_mac[j] = parseHex(v.at(j)); 
    }
  </code></pre>