中国开发网: 论坛: 程序员情感CBD: 贴子 361185
bjwf
给你个例子,不用一分钟就明白了.
FILE * fp = popen("a.exe", "r");
char buf[1024];
char tmp[255];
int count = 1;
while(!feof(fp))
{
int len = fread(buf, 1, sizeof(buf), fp);
if (len > 0)
{
sprintf(tmp, "第%d次", count);
if (strstr(buf, tmp))
{
count++;
//记时 你可以想怎么记就怎么记.
}
printf(buf);
}
}
fclose(fp);

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录