lundi 10 mars 2014

convert string of ints and floats to a float array in C


Vote count:

0




what I'm trying to do is to send a string over the network. the point is that the server which receives the string must make the sum of all the numbers and send it back. so i think the easiest way is to take the string and put it in a float array (it does not matter if ints get in there aswell, since the final sum will be a float number).


unfortunately i have no idea how to do that, or more exactly, how to approach it. how do i take the numbers 1 by 1 from a string (let's say, each number is separated by a space)? there must be some function but i can't find it.


the language is plain C under unix.



asked 2 mins ago






Aucun commentaire:

Enregistrer un commentaire