read data in files
my data is being written to a data file like this.
3.456 3.456 2.345 2.345
3.456 6.788 9.896 9.984
... from left to right.
I want to read the data in another program column wise.
fscanf(fp,"%f, %f, %f, %f",&v1,&v2,&v3,&v4);
having v1 hold the first column, v2 hold the second and so on need a little help.
I am displaying it in GL but it is spitting it out fast like a counter, how to slow it down.
split the fscan command and put it in a loop with a lot of nops (stuf that does noting)
btw: i just know that the statement nop exists in assembly. is there an aquivalent in c? i just switched from assembly to c.
Read the whole file into a 2d array and then display it however you want to.
yes i think trollking is right......... ;)
If you are uncomfortable with 2d arrays, read the data into a single array and define colums as array[i] and array[i+4].
>3.456 3.456 2.345 2.345
>fscanf(fp,"%f, %f, %f, %f",&v1,&v2,&v3,&v4);
If the data stored in the file is delimitted with a spce, why are you reading it with fscanf() with a command as a delimiter? Remove the commas in your fscanf().
>btw: i just know that the statement nop exists in assembly. is there an aquivalent in c? i just switched from assembly to c.
Why do you need this in C though? You might just use a ;, if you really need it.