Guest User

Untitled

a guest
Jul 24th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  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;
Advertisement
Add Comment
Please, Sign In to add comment