Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Scanning whitespace
Index -> Programming, C -> C Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jamonathin




PostPosted: Tue Mar 06, 2007 1:49 pm   Post subject: Scanning whitespace

Anybody know how to scan whitespace?

I need to be able to scan something like
Quote:

Dear, world.

    
I hate you so very, very much.

    
    
Regards, Rosie O'Donnell


With the \n's and \t's in there. Thanks bunch.
Sponsor
Sponsor
Sponsor
sponsor
md




PostPosted: Tue Mar 06, 2007 3:02 pm   Post subject: RE:Scanning whitespace

what do you mean by "scan"? If you mean parse a string, then yes it's super easy. If you mean remove whitespace, then that too is easy.
jamonathin




PostPosted: Tue Mar 06, 2007 4:13 pm   Post subject: Re: Scanning whitespace

Ah sry i ment with user input. How would i scanf/fgets something like that. Or if I were to have it in a file where i would do something like
Quote:

a.out < file.txt
md




PostPosted: Tue Mar 06, 2007 7:59 pm   Post subject: RE:Scanning whitespace

so you want to read in input including whitespace? The easiest way is just to read in characters and add them to a string. There are other ways involving reading entire lines and stuff, but those are slightly more complex.
jamonathin




PostPosted: Tue Mar 06, 2007 8:22 pm   Post subject: Re: Scanning whitespace

Ah, KISS.

Thanks md.
haskell




PostPosted: Tue Mar 06, 2007 9:04 pm   Post subject: RE:Scanning whitespace

This is C, right?

http://www.cplusplus.com/reference/clibrary/cstdio/fread.html
jamonathin




PostPosted: Wed Mar 07, 2007 11:18 am   Post subject: Re: Scanning whitespace

Yeah, thats C.
Display posts from previous:   
   Index -> Programming, C -> C Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: