Thus I have read the data from file and print in display but I cannot save the data read from file into new array.
file data eg:
23,56
78,65
My code
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *ptr = fopen("datasetLR1.txt", "r");
if(ptr == NULL) {
printf("File not found or allocated!");
exit(1);
}
int str[85];
while(fgets(str, sizeof(str), ptr) != NULL) {
printf(fgets(str, sizeof(str), ptr));
}
system("pause");
fclose(ptr);
return 0;
}