Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In c split char* on spaces with strtok function, except if between quotes

Tags:

c

Is there any way to do this with strtok function? or any suggestions ?

Example :

Insert "hello world" to dbms

Result:

Insert
"hello world"
to
dbms
like image 746
Melih Altıntaş Avatar asked Oct 03 '14 21:10

Melih Altıntaş


1 Answers

strtok or any other function in the standard C library can't do this for you. To get it, you have to write code for it yourself, or you have to find some existing code in some external library.

like image 156
pts Avatar answered Nov 15 '22 14:11

pts