C: creating array of strings from delimited source string

前端 未结 5 1517
野的像风
野的像风 2020-12-10 07:52

What would be an efficient way of converting a delimited string into an array of strings in C (not C++)? For example, I might have:

char *input = \"valgrind         


        
5条回答
  •  执念已碎
    2020-12-10 08:32

    Were you remembering to malloc an extra byte for the terminating null that marks the end of string?

提交回复
热议问题