this library helps you for using Local File System

Committer:
hirokimineshita
Date:
Sat Apr 18 03:01:41 2015 +0000
Revision:
6:dbe54101d32f
Parent:
5:6e1bb72b0905
Child:
7:e62c07f356a0
2015/04/18 PM 0 test for reading many times

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hirokimineshita 0:48f30ad8e377 1 #ifndef _LFS_USEFUR_H_20150417_1537_
hirokimineshita 0:48f30ad8e377 2 #define _LFS_USEFUR_H_20150417_1537_
hirokimineshita 0:48f30ad8e377 3
hirokimineshita 5:6e1bb72b0905 4 /** read_some function :
hirokimineshita 5:6e1bb72b0905 5 * @bref read some member of csv format document in local file and write in arrangement
hirokimineshita 5:6e1bb72b0905 6 * @param f write FILE *(name) 's name
hirokimineshita 5:6e1bb72b0905 7 * @param ar arrangement which you want to get data
hirokimineshita 5:6e1bb72b0905 8 * @param num the number of elements you want to get
hirokimineshita 5:6e1bb72b0905 9 */
hirokimineshita 5:6e1bb72b0905 10 void read_some(FILE *f,double *ar,int num){
hirokimineshita 6:dbe54101d32f 11 if(fgetc(f)!=',')fseek(f,-1L,SEEK_SET);
hirokimineshita 6:dbe54101d32f 12 for(int i=0; i<num-1; i++)fscanf(f,"%lf,",&ar[i]);
hirokimineshita 6:dbe54101d32f 13 fscanf(f,"%lf",&ar[num-1]);
hirokimineshita 5:6e1bb72b0905 14 }
hirokimineshita 0:48f30ad8e377 15
hirokimineshita 0:48f30ad8e377 16 #endif