Advertisement
Jambix64

UtilizandoWchar_t

Aug 1st, 2016
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <locale.h>
  3. #include <iostream>
  4. #include <windows.h>
  5.  #define max 100
  6.  using namespace std;
  7.  void funcao(const wchar_t *x);
  8.  
  9. int main()
  10. {
  11.   setlocale(LC_ALL, "pt_BR.UTF-8");
  12.   SetConsoleTitle("L2Titanium");
  13.  
  14.   wchar_t nome [1] = {'a'}; //wchar_t tem um suporte maior de caracteres na faixa de 107 mil;
  15.   int x = wcslen(nome);
  16.  
  17.  
  18.     wchar_t a = 'a';
  19.     funcao(&a);
  20.     cout<<x<<endl;
  21.  
  22.  
  23.  
  24.     char NewNome [100];
  25.     int NewX;
  26.     cin.getline(NewNome,max);
  27.     NewX = strlen(NewNome);
  28.  
  29.     cout<<NewX<<endl;
  30.     system("pause");
  31.     return 0
  32. }
  33.   void funcao(const wchar_t *x){
  34.  
  35.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement