title: Read a file hex data and store into a string 2d array in c++
body: <p>I have &quot;hex.txt&quot; file. It is some data:</p>
  <blockquote>
  <p>gdujdurkndvju;roaen'pefk'ojfsbfwh</p>
  <p>dusigfluyfygrleuieubhfl;wieeufhrr</p>
  <p>ygilrfreusov'rpgtgtgt[s'rgjhery48</p>
  </blockquote>
  <p>I need to read this as a hex and store it as a string 2d array (16 column ).</p>
  <blockquote>
  <p>example :</p>
  <p>67 64 75 6A 64 75 72 6B 6E 64 76 6A 75 3B 72 6F</p>
  <p>61 65 6E 27 70 65 66 6B 27 6F 6A 66 73 62 66 77</p>
  <p>68 0D 0A 64 75 73 69 67 66 6C 75 79 66 79 67 72</p>
  <p>6C 65 75 69 65 75 62 68 66 6C 3B 77 69 65 65 75</p>
  <p>66 68 72 72 0D 0A 79 67 69 6C 72 66 72 65 75 73</p>
  <p>6F 76 27 72 70 67 74 67 74 67 74 5B 73 27 72 67</p>
  <p>6A 68 65 72 79 34 38</p>
  </blockquote>
  <p>This is the code i tried. I need help to complete this code.</p>
  <pre><code>unsigned char hx;
  int main()
  {
  ifstream data(&quot;hex.txt&quot;, std::ios::binary);
  data &gt;&gt; std::noskipws;
  while (data &gt;&gt; hx) {
      std::cout &lt;&lt; std::hex &lt;&lt;std::setw(2)&lt;&lt; std::setfill('0') &lt;&lt; (int)hx&lt;&lt;&quot; &quot;;
  }
  return 0;
  }
  </code></pre>