vector的使用
作者:互联网
std::vector<LPCWSTR> cpaText; cpaText = {L"Hello World!",L"Your Boy Made His First Window!",L"YEAH"}; int iY = 5; for (int iLoopCounter = 0; iLoopCounter < cpaText.size(); iLoopCounter++, iY += 20) { TextOut(hdc, 5, iY, cpaText[iLoopCounter], _tcslen(cpaText[iLoopCounter])); }
用于后面的复习,因为如果使用 LPCWSTR cpaText[ ]最后会出现指针指向未初始化区域导致崩溃
补充: const WCHAR *s1[] = { L“234”, L"123" }; 可以包含多个字符串, 而 const WCHAR *s1只能定义一个字符串
标签:iY,const,cpaText,s1,iLoopCounter,int,vector,使用 来源: https://www.cnblogs.com/strive-sun/p/12600029.html