whitespace « fscanf « C File Q&A

Home
C File Q&A
1.array
2.binary
3.delete
4.Development
5.directory
6.fgets
7.fopen
8.fprintf
9.fscanf
10.fwrite
11.header
12.include
13.input
14.LINE
15.linux
16.open
17.output
18.pointer
19.read
20.size
21.string
22.struct
23.Text
24.windows
25.write
C File Q&A » fscanf » whitespace 

1. Is there a more efficient way of reading a formatted file in C than I have done?    stackoverflow.com

I need to read in a formatted file that looks something like this. Code: HARK Name: Oscar MRTE: Train etc At the moment my code looks like this.

FILE *file;
char unneeded[10];
char whitespace[2];
char actual[10];
file = fopen("scannertest.txt","r");
fscanf(file,"%s",unneeded); // this ...

2. Can fscanf() read whitespace?    stackoverflow.com

I've already got some code to read a text file using fscanf(), and now I need it modified so that fields that were previously whitespace-free need to allow whitespace. The ...

3. fscanf and whitespace    cboard.cprogramming.com

4. fscanf whitespace    cboard.cprogramming.com

5. ignoring whitespace with fscanf    cboard.cprogramming.com

Ok, here is a short background on my problem - I'm just finishing up my C programming class, and want to use what I've learned on a project (mainly because I'm bored.) So, there is an online game called Planetarion that I play which outputs data about each player into a large text file. I want to write a program to ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.