美文网首页
c++ 真的是复杂

c++ 真的是复杂

作者: 皿卜土 | 来源:发表于2020-01-03 10:45 被阅读0次

    https://zh.cppreference.com/w/Cppreference:FAQ

    https://chenxiaowei.gitbook.io/cpp_concurrency_in_action/

    第二版
    https://chenxiaowei.gitbook.io/c-concurrency-in-action-second-edition-2019/praise_for_the_first_edition

    nt* a[2][3];

    int(p)[3] = a;


    (T)0 * (U)0 这是什么鬼
    template<typename T, typename U>
    decltype((T)0 * (U)0) mul(T x, U y)
    {
    return x * y;
    }
    强制把0变成T型指针指向的地址,T也就是所谓指针的跳跃范围,再解指针,后面也是一样的。
    c++11这么写的
    template<typename T, typename U>
    decltype(static_cast<T>(nullptr) * static_cast<U>(nullptr)) mul(T x, U y)
    {
    return x * y;
    }
    又引出static_cast,reinterpret_cast,const_cast,哭。
    c++14这么写
    template<typename T, typename U>
    auto mul(T x, U y)
    {
    return x * y;
    }

    vs条件断点,字符串支持的函数
    strlen, wcslen, strnlen, wcsnlen, strcmp, wcscmp, _stricmp, _wcsicmp, strncmp, wcsncmp, _strnicmp, _wcsnicmp, strchr, wcschr, strstr, wcsstr.
    // ASCII strings
    strcmp(charArrayPointer, "my value")==0 // check if two strings are equal
    strstr(charArrayPointer, "substring")!=0 // check if a string contains the other

    // Unicode strings
    wcscmp(wcharArrayPointer, L"my value")==0 // check if two strings are equal
    wcsstr(wcharArrayPointer, L"substring")!=0 // check if a string contains the other

    // If you are working with std::string, you can get the char array pointer
    // in this way:aString._Bx.Ptr(vs不能用)
    strcmp(&bone_name
    [0],"L_Wrist_End")==0

    相关文章

      网友评论

          本文标题:c++ 真的是复杂

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