检查char中是否存在文本[4000] [英] Check if text exist in char[4000]

查看:74
本文介绍了检查char中是否存在文本[4000]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查char [4000]是否存在文本规则?

How can i check in a char[4000] if a rule of text exist?

推荐答案

函数strstr [
The function strstr[^] can find a sub string in a string and return its location.
char szHaystack[] = "hello world";
char *szNeedle = strstr(szHaystack, "lo");
if (szNeedle == NULL) {
	printf("The string \"lo\" was not found.\n");
} else {
	printf("The string \"lo\" was found %u characters from the start.\n", szNeedle - szHaystack);
}


您可以使用 strstr [ ^ ]在字符串中搜索字符串.
You can use strstr[^] to search for a string in a string.


您的问题有点难以理解,但我认为您可以在
Your question is a little bit hard to understand, but I think what you are looking for can be found here.


这篇关于检查char中是否存在文本[4000]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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