相关疑难解决方法(0)

如何从C中的字符串中提取子字符串?

我尝试使用strncmp,但它只有在我给它一个特定数量的字节我想要提取时才有效.

char line[256] = This "is" an example. //I want to extract "is"
char line[256] = This is "also" an example. // I want to extract "also"
char line[256] = This is the final "example".  // I want to extract "example"
char substring[256]
Run Code Online (Sandbox Code Playgroud)

我如何提取""之间的所有元素?并把它放在变量substring?

c string c-strings

7
推荐指数
1
解决办法
6万
查看次数

标签 统计

c ×1

c-strings ×1

string ×1