Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.