本文介绍了用vprintf()过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用vprintf()过滤掉某些行.我要打印很多,因为这是组装好的包装的数据部分.我只想要内容类型的部分.这不起作用,有任何建议吗?
谢谢

I''m trying to filter out a certain line with vprintf(). I''m getting alot of print out being this is the data part of an assembled packet. I just want the content-type part. This doesn''t work, Any suggestions?
Thanks

vprintf("%c", data[i], "Content-Type: application/x-www-form-urlencoded""");

推荐答案



char *origStr =  "Content-Type: application/x-www-form-urlencoded";
char *searchStr = "Content-Type: ";
char *desiredExerpt, *contentTypeTagPtr;

contentTypeTagPtr = strstr(origStr, searchStr);
desiredExerpt = contentTypeTagPtr + strlen(searchStr);

printf(desiredExerpt);


这篇关于用vprintf()过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 22:53