开发者

Working with wchar in C

I have this code:

#include <stdio.h>
#include <wchar.h>

int main()
{
  wchar_t *foo = L"ðħ";
  wprintf(L"[%ls]\n", foo);      return 0;
}

And when I compile it, it gives me the implicit declaration of function ‘wprintf’ warning. I know that I should link the wchar library during compilation开发者_运维百科, but how do I do that?


Have you tried invoking the compiler with -std=c99 ?


I don't get any warnings when I compile your program. I'm using gcc version 4.2.1 (Apple Inc. build 5646) (dot 1) on OS X.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜