这篇教程C++ strLen函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中strLen函数的典型用法代码示例。如果您正苦于以下问题:C++ strLen函数的具体用法?C++ strLen怎么用?C++ strLen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了strLen函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SelectFormatVOID SelectFormat(IN HWND hDlg, IN LPCTSTR format){ HWND hwndCombo = NULL; int index = -1; DWORD nId = -1; for (int i=0; i<ARRCOUNT(g_vectorFormats); i++) { LPCTSTR fmt = g_vectorFormats[i].strName; if (_tcsncmp(format, fmt, strLen(format)) == 0) { hwndCombo = GetDlgItem(hDlg, IDC_COMBO_VECTOR_FORMAT); index = i; nId = IDC_VECTOR_FORMAT_RADIOBOX; break; } } if (index == -1) { for (int i=0; i<ARRCOUNT(g_rasterFormats); i++) { LPCTSTR fmt = g_rasterFormats[i].strName; if (_tcsncmp(format, fmt, strLen(format)) == 0) { hwndCombo = GetDlgItem(hDlg, IDC_COMBO_RASTER_FORMAT); index = i; nId = IDC_RASTER_FORMAT_RADIOBOX; break; } } } SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)index, 0); // select the radio button next to the combo which we just selected CheckRadioButton(hDlg, IDC_VECTOR_FORMAT_RADIOBOX, IDC_RASTER_FORMAT_RADIOBOX, nId);}
开发者ID:bluebird88,项目名称:virtualprinter,代码行数:35,
示例2: strBeginsWithint strBeginsWith(char* a, char*b){ if(strLen(a) < strLen(b)) return 0; int i = 0; while(a[i] == b[i]) i++; if(b[i] == 0) return 1; return 0;}
开发者ID:kevinsa5,项目名称:KevinOS,代码行数:7,
示例3: replacechar* replace(char* str, char replacing, char* with){ int strL = strLen(str); char* result = addSpaces(str); int newLen = strLen(result); int withLen = strLen(with); int i = 0; while ((strL - 1)!= 0) { if (str[strL - 1] != replacing) { result[newLen - 1] = str[strL - 1]; newLen--; strL--; } else { for (i = withLen - 1; i >= 0 ; i--) result[--newLen] = with[i]; strL--; } } return result;}
开发者ID:dochia,项目名称:cracking-code-interview,代码行数:25,
示例4: strCopyvoid strCopy(char* dest, const char* src){ ASSERT(strIsValid(src)); ASSERT(memIsValid(dest, strLen(src) + 1)); ASSERT(memIsDisjoint(src, dest, strLen(src) + 1)); memcpy(dest, src, strLen(src) + 1);}
开发者ID:agievich,项目名称:bee2,代码行数:7,
|