468,513 Members | 975 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

Printing out Unicode characters

1
My mission is to print Unicode characters using this program.I have been on this for several months.
I follow the following procedure to enable unicode;
1.File > New> Project>win 32 console application> simple application.
2.File > New > c++ source file
3.Project > setting>(General tab)Not using mfc > (c/c++ tab)preprocessor > _UNICODE Precompiled header >Not using precompiled header

#include<fstream.h>
#include<stddef.h>
#include<wchar_t.h>
#include<tchar.h>
int main(argv* .......)
{
wchar_t c;
for(c = 1; c < 65536; c++)
{ cout << (TCHAR)c;}
return 0;
}

I need your suggestion.
Dec 13 '07 #1
1 8514
weaknessforcats
9,207 Expert Mod 8TB
You cannot use wchar_t, char, cout, etc.... in a Windows program. You need to stick with the TCHAR mappings.
Expand|Select|Wrap|Line Numbers
  1. #include <windows.h>
  2. #include<fstream.h>
  3. #include<tchar.h>
  4. int _tmain(int argc, _TCHAR* argv[])
  5. {
  6. TCHAR c;
  7. for(c = 1; c < 65536; c++)
  8. { _tprintf(TEXT("%c\n"), c);
  9. return 0;
  10. }
  11.  
Dec 13 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Pekka Niiranen | last post: by
11 posts views Thread by Marian Aldenhvel | last post: by
4 posts views Thread by Basil | last post: by
29 posts views Thread by Ron Garret | last post: by
1 post views Thread by sheldon.regular | last post: by
5 posts views Thread by Xah Lee | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.