相关疑难解决方法(0)

检查子字符串存在于C中的字符串中

我正在尝试检查字符串是否包含C中的子字符串,如:

char *sent = "this is my sample example";
char *word = "sample";
if (/* sentence contains word */) {
    /* .. */
}
Run Code Online (Sandbox Code Playgroud)

什么是使用而不是string::find在C++中?

c string

148
推荐指数
5
解决办法
40万
查看次数

标签 统计

c ×1

string ×1