LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

string to double

hi,

I'm trying to read spectrum data of an spectrum analyzer and using VISA commands.

I can get trace data as a string in ASCII format in a form in which each double elements are comma-separated.

How can I format this stringto a double array?

 

thanks a lot

0 Kudos
Message 1 of 2
(3,166 Views)

Maybe this can help :

 

// Split data string into points, convet to double, and output

token = strtok( data, "," );

dataPoint = atof(token); // Convert to double

 

you can also use Fmt() and Sprintf() for manipulate strings

-----------------------------------------
Kobi Kalif
Software Engineer

Message 2 of 2
(3,164 Views)