c++ 真的是复杂

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。