C統合・質問スレッド
at TECH
829:デフォルトの名無しさん
08/01/30 20:26:33
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
char str[256] = "<a href=\"URLリンク(localhost\)<)">link2</a>";
char *ptr;
int i = 0;
ptr = str;
while(1)
{
ptr = strstr(ptr,"http://");
if(!ptr)
break;
ptr += 7;
i++;
}
printf("http://の出現数は%dです。\n",i);
return 0;
}
http://の出現回数を数えているのですが、
悪い点、改善点等のご指摘を下さい。
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5373日前に更新/239 KB
担当:undef