I have a file with data like
zz:yy:xx.xxx [-]pp.pp
The minus is optional. I need to separate the data. I need that [-]pp.pp
to the next actions in float type. How can I make an float array with that part of data?
Here I opened the file and printed all data.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 2000
FILE *file;
int main()
{
file = fopen("data.txt" , "r");
int i,znak=0;
char string[N];
while ((znak = getc(file)) != EOF)
{
string[i]=znak;
printf("%c",string[i]);
i++;
}
return 0;
}