C統合・質問スレッド at TECH
[2ch|▼Menu]
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