Thread: File I/o

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    142

    File I/o

    peoples, i need help with file i/o, what i need is to be able to store data and retrieve it when i want, my project is a simple database, now, i have ben playing with file i/o for a little while now and i am still a noob but i'm still having trouble storing the data and then being able to retrieve it once i have stored it, should i be using text files or is there something else? i know this is probably a broud question but the tutorials don't go any further and i don't know what to do, can you help?
    WhAtHA hell Is GoInG ON

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    There's also binary files.


    Think about the data you want to store and retrieve. Think about all the operations you want to perform on this data. Then think about a suitable disk format for it.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Quote Originally Posted by CornedBee
    There's also binary files.


    Think about the data you want to store and retrieve. Think about all the operations you want to perform on this data. Then think about a suitable disk format for it.
    would it be better using binary files for this or would you recommand using text files?
    WhAtHA hell Is GoInG ON

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    What is this? You haven't told us anything except that it is "a simple database", which says absolutely nothing.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Quote Originally Posted by CornedBee
    What is this? You haven't told us anything except that it is "a simple database", which says absolutely nothing.
    what eva, no need to be an .............., i'm still very new to this, Man all i want is some help
    WhAtHA hell Is GoInG ON

  6. #6
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Don't worry about it man i'll figure it out my self FFS....................
    WhAtHA hell Is GoInG ON

  7. #7
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Can or do you understand how the fstream header functions work? Read up on it, check out online help also.
    Give us an example of what you have done so far if you can.
    Double Helix STL

  8. #8
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> what eva, no need to be an .............., i'm still very new to this, Man all i want is some help
    Re-read that post again, this time assuming that CornedBee was being helpful and not being mean. Sometimes it is difficult to identify a person's tone over the internet, so it might be better if you always assumed a person has a positive tone instead of a negative one.

  9. #9
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    a.k.a., we need more information.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  10. #10
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Quote Originally Posted by Daved
    >> what eva, no need to be an .............., i'm still very new to this, Man all i want is some help
    Re-read that post again, this time assuming that CornedBee was being helpful and not being mean. Sometimes it is difficult to identify a person's tone over the internet, so it might be better if you always assumed a person has a positive tone instead of a negative one.
    Ok, i imagined me saying it with a smile on my face, Sorry didn't work, i understand what you are saying tho, i understand i didn't give enough information but he didn't come straight out and say that!
    WhAtHA hell Is GoInG ON

  11. #11
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    now that i have had a look at it the question is way to difficult to answer without more information, i could be talking about anything involved with file i/o.

    i am familliar with fstream functions but havn't mastered them yet, what i need is a good reference to these function, if you could just help me with that i should be able to help myself.
    WhAtHA hell Is GoInG ON

  12. #12

  13. #13
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    I also getting a decent book that teaches more advanced C++ try
    Acellerated C++. Many other books do not concentrate too much on file io when reading and writing to files is a programs main goal
    Double Helix STL

  14. #14
    Registered User
    Join Date
    Sep 2005
    Posts
    142
    Quote Originally Posted by swgh
    I also getting a decent book that teaches more advanced C++ try
    Acellerated C++. Many other books do not concentrate too much on file io when reading and writing to files is a programs main goal
    wikd thanks mate! england are doing better in the second test ay
    WhAtHA hell Is GoInG ON

  15. #15
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Im not really into cricket but glad they are pulling it back, more of a footie person
    Double Helix STL

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. 2 questions surrounding an I/O file
    By Guti14 in forum C Programming
    Replies: 2
    Last Post: 08-30-2004, 11:21 PM
  4. File I/O problems!!! Help!!!
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 05-17-2002, 08:09 PM
  5. advice on file i/o
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-29-2001, 05:56 AM