Converting an array to a string

Thread Starter

Jorgy

Joined Oct 10, 2009
8
Hello Everyone,

I have an array in my C code that consists of 50000 samples of positive and negative digits. Is there anyway I can turn this array into a string?
 

KL7AJ

Joined Nov 4, 2008
2,229
Hello Everyone,

I have an array in my C code that consists of 50000 samples of positive and negative digits. Is there anyway I can turn this array into a string?

Hmmm....well if this was Labview, I'd just wire up a "convert array to string" vi. Guess that's not what you're looking for, though. :0


If you're trying to do this in C, the fscanf is the function you want. This will scan a string (or array) of ny dimension, and format it into any array you want.


Eric the Helpful
 
Last edited:

spinnaker

Joined Oct 29, 2009
7,830
Hello Everyone,

I have an array in my C code that consists of 50000 samples of positive and negative digits. Is there anyway I can turn this array into a string?
In straight C a string is an array. (Actually even in C++).


Are you using C or C++?


What kind of "digits" are they? Integer? Floats? Char?

Do you want each number it it's own string, an array of strings or all of the numbers in one string?


If you can define exactly what you are trying to do, I may be able to help a big more.
 
Last edited:
Top