开发者

How to extract a subpart of char* [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Modify a char* string in C

I have:

char* htmlstring = "htmldata"

How do I extract:

char* htmlstring1 = "htmldata 开发者_如何转开发before </body>tag"

char* htmlstring2 ="htmldata after and including</body> tag"

Can I use strstr? Whats the best approach?


strncpy(destination_string, source + start, count)

It's not really safe, but works. You should wrap it around.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜