home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
dos_util
/
v12n19.zip
/
UNI.ZIP
/
UNITEST2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-23
|
1KB
|
52 lines
/*-----------------------------------------
UNITEST2.C -- Unicode Test Program #2
(c) Charles Petzold, 1993
-----------------------------------------*/
#include <wchar.h>
#include <stdio.h>
#include <string.h>
int main (void)
{
int i ;
char acString [] = "Hello, world!" ;
wchar_t wcString [] = L"Hello, world!" ;
printf ("The acString array is %s\n", acString) ;
printf ("The string occupies %d bytes\n", sizeof (acString)) ;
printf ("The string is %d characters long\n", strlen (acString)) ;
printf ("The string begins: ") ;
for (i = 0 ; i < 5 ; i++)
printf ("%c ", acString [i]) ;
printf ("\n") ;
printf ("The string begins: ") ;
for (i = 0 ; i < 5 ; i++)
printf ("%02X ", acString [i]) ;
printf ("\n\n") ;
wprintf (L"The wcString array is %s\n", wcString) ;
wprintf (L"The string occupies %d bytes\n", sizeof (wcString)) ;
wprintf (L"The string is %d characters long\n", wcslen (wcString)) ;
wprintf (L"The string begins: ") ;
for (i = 0 ; i < 5 ; i++)
wprintf (L"%c ", wcString [i]) ;
wprintf (L"\n") ;
wprintf (L"The string begins: ") ;
for (i = 0 ; i < 5 ; i++)
wprintf (L"%04X ", wcString [i]) ;
return 0 ;
}