美文网首页
宽窄字符

宽窄字符

作者: 苍老师的眼泪 | 来源:发表于2022-11-06 11:44 被阅读0次

    头文件:

    #include <stdio.h>
    #include <string.h>
    #include <tchar.h>
    

    窄字符 char 类型

        const char * str = "Edison";
        printf("%d", strlen(str));
    

    宽字符 wchar_t 类型

        const wchar_t * str = L"蔡徐坤";
        printf("%d", wcslen(str));
    

    通用类型

        const TCHAR * str = _T("蔡徐坤");
        printf("%d", _tcslen(str));
    

    相关文章

      网友评论

          本文标题:宽窄字符

          本文链接:https://www.haomeiwen.com/subject/cembtdtx.html