如何计算c中的行数 [英] how do count row in c

查看:83
本文介绍了如何计算c中的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用套接字从服务器接收数据

i获取html文本中的完整代码我解析它并使用字符串i打印指定标签我想计算输出中打印的行数我该如何做?

如何我在COK中打印行打.......







if(strstr(token,A)!= NULL)

{

printf(%s,token);



}

i receive data from sever using socket
i got full code in html text i parse it and using string i print specify tags i want to count how many row are prints in output how can i do thaT
how cAN I COUNT ROW PRINT IN TOKEN.......



if(strstr(token,A) !=NULL)
{
printf("%s",token);

}

推荐答案

如何添加一个充当你的函数的计数器的变量?例如



what about adding a variable acting as a counter to your function? E.g.

if(strstr(token,A) !=NULL)
{
  printf("%s",token);
  counter++;
}


这篇关于如何计算c中的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆