[阅读: 385] 2006-07-18 08:58:41
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);