title: char* decimal to hexadecimal in little-endian
body: <p>I have an issue where I am inputting an decimal argument to my code:</p>
  
  <pre><code>./a.out 650
  </code></pre>
  
  <p>and would like to simply convert the decimal value into hex and output it in a little-endian format:</p>
  
  <pre><code>0A28
  </code></pre>
  
  <p>My current solution has been to convert the char* to decimal using atoi (we can assume the input is decimal, no worry about error cases). </p>
  
  <p>I have read that I could create an int* and cast it to the char*, something like this:</p>
  
  <pre><code>char* bar = argv[1];
  int* foo = (char*)&amp;bar;
  </code></pre>
  
  <p>and that iterating through it would produce the solution I needed, but I do not quite understand how that would work.</p>