Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
lfs_useful.h@7:e62c07f356a0, 2015-04-18 (annotated)
- Committer:
- hirokimineshita
- Date:
- Sat Apr 18 09:31:57 2015 +0000
- Revision:
- 7:e62c07f356a0
- Parent:
- 6:dbe54101d32f
- Child:
- 8:38e295ef7892
2015/04/18 PM 6 miner change
Who changed what in which revision?
| User | Revision | Line number | New 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 | 7:e62c07f356a0 | 4 | /** @file |
| hirokimineshita | 7:e62c07f356a0 | 5 | */ |
| hirokimineshita | 7:e62c07f356a0 | 6 | |
| hirokimineshita | 5:6e1bb72b0905 | 7 | /** read_some function : |
| hirokimineshita | 5:6e1bb72b0905 | 8 | * @bref read some member of csv format document in local file and write in arrangement |
| hirokimineshita | 5:6e1bb72b0905 | 9 | * @param f write FILE *(name) 's name |
| hirokimineshita | 5:6e1bb72b0905 | 10 | * @param ar arrangement which you want to get data |
| hirokimineshita | 5:6e1bb72b0905 | 11 | * @param num the number of elements you want to get |
| hirokimineshita | 5:6e1bb72b0905 | 12 | */ |
| hirokimineshita | 5:6e1bb72b0905 | 13 | void read_some(FILE *f,double *ar,int num){ |
| hirokimineshita | 6:dbe54101d32f | 14 | if(fgetc(f)!=',')fseek(f,-1L,SEEK_SET); |
| hirokimineshita | 6:dbe54101d32f | 15 | for(int i=0; i<num-1; i++)fscanf(f,"%lf,",&ar[i]); |
| hirokimineshita | 6:dbe54101d32f | 16 | fscanf(f,"%lf",&ar[num-1]); |
| hirokimineshita | 5:6e1bb72b0905 | 17 | } |
| hirokimineshita | 0:48f30ad8e377 | 18 | |
| hirokimineshita | 0:48f30ad8e377 | 19 | #endif |