Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 24th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Appending char/wide char to the c-string
  2. #ifndef UNICODE
  3. #define UNICODE
  4. #endif
  5.  
  6. #include <stdio.h>
  7. #include <Windows.h>
  8.  
  9. int main(void)
  10. {
  11.    TCHAR greeting[50] = L"Hello world";
  12.    TCHAR exclamation=L'!';
  13.  
  14.  //????
  15.  
  16. wprintf("%s",greeting);
  17.  
  18. return 0;
  19. }
  20.        
  21. TCHAR greeting[50] = L"Hello world";
  22. TCHAR exclamation=L'!';
  23.  
  24. greeting[wcslen(greeting)+1] = L'';        
  25. greeting[wcslen(greeting)] = exclamation;