不知那里的问题。搞的我以为wsccmp函数错了,花了一天的时间。
在gcc中,wchar_t因该是几字节的?或者编译开关如何设定?
在线等待
4 个解决方案
#1
有2字节有4字节的
#2
32位系统
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux
sizeof wchar_t = 4
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux
sizeof wchar_t = 4
#3
帮LZ顶 LZ加油
#4
在GCC上就是4个字节,具体是两个字节还是四个字节是跟编译器相关的,在windows下是两个bytes,
以下文字摘自: What size wchar_t do I need for Unicode?
http://icu.sourceforge.net/docs/papers/unicode_wchar_t.html
The C standard does not specify the exact type for wchar_t. It is compiler dependent and may be 8, 16, or 32 bits wide (on modern machines), signed or unsigned. The choice depends on what encodings are expected to be processed on a particular platform. The standard also does not specify the representation of a multibyte code point with a wchar_t value: it is encoding- and library-dependent (except that a single-byte code point must have the same integer value in char and wchar_t types).
以下文字摘自: What size wchar_t do I need for Unicode?
http://icu.sourceforge.net/docs/papers/unicode_wchar_t.html
The C standard does not specify the exact type for wchar_t. It is compiler dependent and may be 8, 16, or 32 bits wide (on modern machines), signed or unsigned. The choice depends on what encodings are expected to be processed on a particular platform. The standard also does not specify the representation of a multibyte code point with a wchar_t value: it is encoding- and library-dependent (except that a single-byte code point must have the same integer value in char and wchar_t types).
#1
有2字节有4字节的
#2
32位系统
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux
sizeof wchar_t = 4
Linux localhost.localdomain 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 i686 i386 GNU/Linux
sizeof wchar_t = 4
#3
帮LZ顶 LZ加油
#4
在GCC上就是4个字节,具体是两个字节还是四个字节是跟编译器相关的,在windows下是两个bytes,
以下文字摘自: What size wchar_t do I need for Unicode?
http://icu.sourceforge.net/docs/papers/unicode_wchar_t.html
The C standard does not specify the exact type for wchar_t. It is compiler dependent and may be 8, 16, or 32 bits wide (on modern machines), signed or unsigned. The choice depends on what encodings are expected to be processed on a particular platform. The standard also does not specify the representation of a multibyte code point with a wchar_t value: it is encoding- and library-dependent (except that a single-byte code point must have the same integer value in char and wchar_t types).
以下文字摘自: What size wchar_t do I need for Unicode?
http://icu.sourceforge.net/docs/papers/unicode_wchar_t.html
The C standard does not specify the exact type for wchar_t. It is compiler dependent and may be 8, 16, or 32 bits wide (on modern machines), signed or unsigned. The choice depends on what encodings are expected to be processed on a particular platform. The standard also does not specify the representation of a multibyte code point with a wchar_t value: it is encoding- and library-dependent (except that a single-byte code point must have the same integer value in char and wchar_t types).