wchar_t* wcschr(const wchar_t* kwpWideString, wchar_t wWideChar);
#include <cwchar> int main() { wchar_t waWideString[] = L"XoaX.net"; wchar_t wSearched = L'.'; wprintf(L"Searching \"%ws\" for \"%wc\"\n", waWideString, wSearched); // Search the string for a period wchar_t* wpFound = wcschr(waWideString, wSearched); int iFoundIndex = (int)(wpFound - waWideString); wprintf(L"The first \"%wc\" was found at the index %d.\n", wSearched, iFoundIndex); // Keep the window open until "Enter" is pressed getwchar(); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.