Modifying A Record In C++...help Needed

This is a discussion on Modifying A Record In C++...help Needed within the C++ Programming forums, part of the General Programming Boards category; PLEASE CAN ANYONE HELP ME AS TO HOW TO MODIFY A RECORD IN A FILE.....SUPPOSE I HAVE THIS FILE STRUCTURE: ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    Unhappy Modifying A Record In C++...help Needed

    PLEASE CAN ANYONE HELP ME AS TO HOW TO MODIFY A RECORD IN A FILE.....SUPPOSE I HAVE THIS FILE STRUCTURE:

    RECORD # 1(LINE 1)
    RECORD # 2(LINE 2)
    RECORD #3 (LINE 3)
    RECORD # 4(LINE 4)

    NOW THAT I WANNA MODIFY THE THIRD RECORD...HOW DO I DO THAT..PLEASE HELP....!

    USING C++ ONLY,

    THNX,
    REGARDS,
    CONQUERER
    Last edited by Conquerer; 09-28-2001 at 03:32 PM.

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    A record of what? A database? What kind?

    Also, don't yell - it'll limit the amount of people that want to help you.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    155
    Assuming each Record is composed of several different fields and the data in each field is numerical or a string without internal spaces and each field represents a data member of a userdefined struct or class then you can use the read() method of ifstreams to read in the information one record at a time or the input each field separately using the >>, which may need to be overloaded if the fields don't correlate to a primitive type. Are you using a container to hold all the Records? As you can see, much more information is needed before a definitive answer can be provided, and this is just for the simplest type of Record I can think of. Work out what you can and then ask a more focused question if you need to.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with binary file c++
    By lucky_mutani in forum C++ Programming
    Replies: 4
    Last Post: 06-05-2009, 10:24 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  3. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 01:18 AM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 02:27 PM
  5. behind and confused
    By steviecrawf in forum C Programming
    Replies: 1
    Last Post: 11-09-2001, 12:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21