C統合・質問スレッドat TECH
C統合・質問スレッド - 暇つぶし2ch829:デフォルトの名無しさん
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