Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello I am trying to solve this problem about double quotes. I used strtok() to remove the double quotes but it only removes the second ". So the output becomes a = "b but the output I want is a = b.

What I have tried:

strtok(inttbo[ctr].value1, "\"\"");
Posted
Updated 9-Oct-17 17:43pm
Comments
Peter_in_2780 9-Oct-17 23:43pm    
Hint: Each call to strtok() returns one token (and remembers where it is up to). Read the documentation. Slowly.

1 solution

You should be calling strtok in a loop.
You're also using double quotes twice in the delimiter parameter.
char* token = strtok(inttbo[ctr].value1, "\"");
while (token != NULL)  
{
   // Your deletion logic goes here.
   token = strtok(NULL, "\"");
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900