title: GetLogicalDriveStrings() and char - Where am I doing wrongly
body: <p>I want to search a file which may be present in any drives such as C:\, D:\ etc. Using <code>GetLogicalDriveStrings</code> I can able to get the list of drives but when I add anything extra for the output, I am getting a <code>null</code> in the output prompt. Here is my code:</p>
  
  <pre><code>#include "StdAfx.h"
  #include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;conio.h&gt;
  
  // Buffer length
  DWORD mydrives = 100;
  // Buffer for drive string storage
  char lpBuffer[100];
  const char *extFile = "text.ext";
  
  // You may want to try the wmain() version
  int main(void)
  {
      DWORD test;
      int i;
      test = GetLogicalDriveStrings(mydrives, (LPWSTR)lpBuffer);
      if(test != 0)
      {
          printf("GetLogicalDriveStrings() return value: %d, Error (if any): %d \n", test, GetLastError());
          printf("The logical drives of this machine are:\n");
          // Check up to 100 drives...
          for(i = 0; i&lt;100; i++)
          printf("%c%s", lpBuffer[i],extFile);
          printf("\n");
      }
      else
          printf("GetLogicalDriveStrings() is failed lor!!! Error code: %d\n", GetLastError());
      _getch();
      return 0;
  }
  </code></pre>
  
  <p>I want above output as <code>C:\text.ext D:\text.ext ...</code> rather I am getting <code>text.ext</code> only. I am using <code>Microsoft Visual C++ 2010 Express</code></p>