title: How to convert Byte Array to hex string in visual c++?
body: <p>Declaration of a method are following:</p>
  
  <pre><code>//some.h
  void TDES_Decryption(BYTE *Data, BYTE *Key, BYTE *InitalVector, int Length);
  </code></pre>
  
  <p>I am calling this method from the following code:</p>
  
  <pre><code>//some.c
  extern "C" __declspec(dllexport) bool _cdecl OnDecryption(LPCTSTR stringKSN, LPCTSTR BDK){
      TDES_Decryption(m_Track1Buffer, m_cryptoKey, init_vector, len);
      return m_Track1Buffer;
  }
  </code></pre>
  
  <p>Where as data type of <code>m_Track1Buffer</code> is <code>BYTE m_Track1Buffer[1000];</code>
  Now i want to make some changes in above method i.e. want to return the <code>String in hex</code> instead of <code>Byte</code>. How should i convert this <code>m_Track1buffer</code> to <code>Hex string</code></p>