CFanatic

Go Back   CFanatic > Programming > C++ Programming

Join CFanatic Forum Now

need help in urgent...(file stream) topic posted under C++ Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2008, 03:33 AM
Junior Member
 
Join Date: Jul 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
kslpeter87 is on a distinguished road
| More
need help in urgent...(file stream)

The problem as follow:
Create Inventory structure contain members:
1.item description
2.quantity
3.date added item

Then store the structure into a .txt file. (i name it as "Inventory.txt")
Display a menu to let user choose an option:
1. Insert new record
2. Display any record in the txt file
3. Edit/update any record in the txt file



How to access to a particular record in the txt file i created ???
i've tried my best to look for solution in the reference books yet couldn't get an answer.
Anyone here could suggest an algorithm to perform that task ?



My Inventory.txt: (i use "_" to replace " ")

Description___________________quantity________date added
Colour pencil_________________6_______________03/03/2008
Eraser________________________20______________02/03/2008
Reply With Quote
  #2  
Old 07-31-2008, 05:34 PM
Senior Member
 
Join Date: Jul 2008
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
xpi0t0s is on a distinguished road
| More
Re: need help in urgent...(file stream)

There's not much you need by way of an algorithm, pretty much just open the file, loop through it until you find the record you want then do whatever you want with that record.

How far have you got with the program and where are you stuck?
Reply With Quote
Reply

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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a program that reads input as a stream of characters until EOF new4c C Programming 3 05-31-2008 01:38 PM
File I/O (Reading from a Random-Access File) VersEtreOuNe C++ Programming 0 02-12-2008 03:39 PM
read file n spot blank char n re write file witout extra blank dev1910 C++ Programming 1 12-17-2007 12:43 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:46 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board