I use the following code and get the output below.
Original string is -CCY 1.2624 Up 0.0006(0.05%) 01:37 [37]
char* pch;
pch = strtok (buffer," ");
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, " ");
}
This is my output
CCY
1.2624
Up
0.0006(0.05%)
01:37
SGT
[37]
How do I get the 1.2624 and assign it to a cstr so i can use it later like printf or something when outside of the while loop?
Provided that
buffercan be splitted to two or more items