this library helps you for using Local File System

Revision:
6:dbe54101d32f
Parent:
5:6e1bb72b0905
Child:
7:e62c07f356a0
diff -r 6e1bb72b0905 -r dbe54101d32f lfs_useful.h
--- a/lfs_useful.h	Fri Apr 17 07:15:08 2015 +0000
+++ b/lfs_useful.h	Sat Apr 18 03:01:41 2015 +0000
@@ -8,7 +8,9 @@
  * @param num the number of elements you want to get
  */
 void read_some(FILE *f,double *ar,int num){
-    for(int i=0; i<num; i++)fscanf(f,"%lf,",&ar[i]);
+    if(fgetc(f)!=',')fseek(f,-1L,SEEK_SET);
+    for(int i=0; i<num-1; i++)fscanf(f,"%lf,",&ar[i]);
+    fscanf(f,"%lf",&ar[num-1]);
 }
 
 #endif
\ No newline at end of file