Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 20th, 2006, 08:53 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need HELP with: Formated Input form file

Hi everybody!
I'm have to read a file - which format is [u]known</u>!

My file looks like that:
User 1
Connections 10

User 2
Connections 14

max buffer size = 50

the number of "users" is unknowk, it means that I don't know how many pairs of:
"User X
Connections Y"

I need to get somehow the User's id and connection number from the file and store them in local dataMembers (int id & int conNum).

How to do this?

Thanks!
Reply With Quote
  #2 (permalink)  
Old December 22nd, 2006, 06:19 AM
Authorized User
 
Join Date: Oct 2006
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello loony,

 can you post you code so that we can understand what is really your problem and to understand what do want to entend for...

______________________________________
.::If you quit you loss, If you survive you win::.

.::JHANNY::.

Reply With Quote
  #3 (permalink)  
Old December 22nd, 2006, 08:18 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: Fort Wayne, Indiana, USA.
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Geo121
Default

Looney I understand your problem

I also have the answer

however, this sounds similar to an assignment given by a teacher

so I will tell you the library you should use

and then you will show me how you think it is done then I will help you fix it okay?

coolio =P

just look up the fstream library or a.k.a. <fstream.h>

this library controls reading and writing of files of ANY format

so look it up and show me what you got

~ Geo

~ Don't take life too seriously, you'll never get out alive!
Reply With Quote
  #4 (permalink)  
Old December 25th, 2006, 06:43 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually it's just a little part of a huge project. I not very good with working with files. I forgot the exictance of fscanf - and this solved my problem.
Thanks.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xml Files read in asp with formated data shaileshk Classic ASP XML 1 June 7th, 2006 04:53 AM
input form ( onclick) bubblegirl Javascript How-To 1 March 6th, 2006 01:48 AM
Opening the formated output in browser msrnivas General .NET 1 January 18th, 2005 08:29 AM
submitting a form have an input File alyeng2000 Classic ASP Basics 6 November 1st, 2003 09:22 PM
Multiple file input single file output.... jdm_mboy Biztalk 1 July 2nd, 2003 03:35 AM



All times are GMT -4. The time now is 02:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.