![]() |
| | #1 |
| Registered User Join Date: Jun 2009
Posts: 31
| fscanf: read word from file I have a file like that: 1 2 3 4 5 6 7 8 and I want print on stdout: 1 3 8 in other words i want choose what print out. I was thinking to use fscanf as: Code: fscanf(file_in,"%d %d %d ", &a , &b, &c ); 1 2 3 Is there a solution using fscanf to obtain my purpose? Thanks D |
| Dedalus is offline | |
| | #2 |
| Registered User Join Date: Jun 2009
Posts: 31
| Hi I got it It's enough to insert a format type indicator, something like: fscanf(file_in,"%d %*1hd %d ",&a, &b,&c); D |
| Dedalus is offline | |
![]() |
| Tags |
| file, fscanf |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Seg Fault in Compare Function | tytelizgal | C Programming | 1 | 10-25-2008 03:06 PM |
| seg fault at vectornew | tytelizgal | C Programming | 2 | 10-25-2008 01:22 PM |
| C++ std routines | siavoshkc | C++ Programming | 33 | 07-28-2006 12:13 AM |
| Dikumud | maxorator | C++ Programming | 1 | 10-01-2005 06:39 AM |
| simulate Grep command in Unix using C | laxmi | C Programming | 6 | 05-10-2002 04:10 PM |