Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-08-2005, 07:35 AM   #1 (permalink)
gamehead200
Code Monkey
 
gamehead200's Avatar
 
Join Date: Oct 2004
Posts: 57
gamehead200 is an unknown quantity at this point
Reading Up To Certain Point

Hey everyone...

Its been a while since I posted here...

Anywayz, my question is the following:

When doing file reading, how can I make my program read up to a certain character instead of whitespace? What I want to do is go through a file and read up to a semi-colon, then continue until the next one and so on...

Any help would be appreciated!
gamehead200 is offline   Reply With Quote
Old 05-08-2005, 08:31 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Some pseudocode:
Code:
while ( Read one line from file )
      split it at ";" using strtok()
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 05-08-2005, 09:12 AM   #3 (permalink)
Feis
Registered User
 
Join Date: Apr 2005
Posts: 18
Feis is on a distinguished road
To do that, you can use cin.get()

here's a page on it:
http://cplusplus.com/ref/iostream/istream/get.html
Feis is offline   Reply With Quote
Old 05-09-2005, 12:07 PM   #4 (permalink)
gamehead200
Code Monkey
 
gamehead200's Avatar
 
Join Date: Oct 2004
Posts: 57
gamehead200 is an unknown quantity at this point
Yay! I had to read up on strtok but I finally got it working! Thanks guys!
gamehead200 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[anti spam] I like this kind of reading. Valmont Lounge 18 05-08-2005 09:58 AM
Delphi, Reading In Data! dazzdave All Other Coding Languages 3 03-22-2005 03:35 PM
Error java.net.ProtocolException: Cannot write output after reading input. wishknew Java 4 03-07-2005 04:01 PM
What're you reading? inkedmn Lounge 18 05-08-2004 07:22 PM


All times are GMT -8. The time now is 01:06 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting