掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
検索対象の文字が文字列中に何個存在するか調べるには? (ID:71959)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
もいっちょ、STLに任す。 #include <afxwin.h> #include <iostream> #include <algorithm> using namespace std; int main() { CString str = "abcdefd"; cout << count((const char*)str, (const char*)str+str.GetLength(), 'd') << endl; }
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.