开发者

Working with wchar in C

开发者 https://www.devze.com 2023-01-02 09:43 出处:网络
I have this code: #include <stdio.h> #include <wchar.h> int main() { wchar_t *foo = L\"ðħ\";

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

精彩评论

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