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://の出現回数を数えているのですが、
悪い点、改善点等のご指摘を下さい。