Hi Intel_Jesus
I've triedyourcode,is of greathelp,my question is:justread the codesaved aswellif:
90
150
200
215
320
420
520
infile "servo.txt"
- file= fopen("/media/realroot/servo.txt" , "rt");
- if (file) {
- while (fgets(line, 100, file) != NULL){
- sscanf (line, "%ld", &Value);
- printf ("%ld\n", Value);
- array[count] = Value;
- count++;
- }
may be it'sbecausethefgets() function; onlyrunsuntil it findsa number,iffor example,myfile issavedin this way:
90,150,200,215,320,420,520onlywould printthe value90, because afterthisone "," andthefgets() function; only recognizesnumbers.
And myidea would be. thusaccommodate90,150,200,215,320,420
Description
Locates a character or String within another String. By default, searches from the beginning of the String, but can also start from a given index, allowing for the locating of all instances of the character or String.
Syntax string.indexOf(val)
string.indexOf(val, from)
Parameters
string: a variable of type String
val: the value to search for - char or String
from: the index to start the search from
Regards,