I/o

This is a discussion on I/o within the C++ Programming forums, part of the General Programming Boards category; Using <fstream.h> <IOSTREAM> or whatever is there a way to store a variable in a file like a .txt file ...

  1. #1
    RPW
    RPW is offline
    Registered User
    Join Date
    Dec 2002
    Posts
    43

    I/o

    Using <fstream.h> <IOSTREAM> or whatever is there a way to store a variable in a file like a .txt file or whatever and some otherstuff and go strait to that variable and read it with a pointer or something?
    if(you.control(own.life())==true)
    {...}
    else
    {
    someone.else();
    will()
    }

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    what are u trying to do?

  3. #3
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    He's talking about accessing a variable stored in a file through a pointer. Sorry, it's impossible (unless you're running on virtual memory, but that doesn't count.)

  4. #4
    RPW
    RPW is offline
    Registered User
    Join Date
    Dec 2002
    Posts
    43

    Exclamation Darn

    I guess i have to try to right a class or two form it then
    if(you.control(own.life())==true)
    {...}
    else
    {
    someone.else();
    will()
    }

  5. #5
    booyakasha
    Join Date
    Nov 2002
    Posts
    208
    Do you mean like a pointer to part of a file on the hard disk?

  6. #6
    RPW
    RPW is offline
    Registered User
    Join Date
    Dec 2002
    Posts
    43

    Exclamation Ya

    Like a pointer or reference or whatever to find a spot and be able to read from it.

  7. #7
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,788
    I suppose if you saved the offset into the file where you wrote the particular piece of data you are interested in, then you could later use fseek to go to that location when you read from the file.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  8. #8
    RPW
    RPW is offline
    Registered User
    Join Date
    Dec 2002
    Posts
    43

    Question HOW?

    How do u use that effectivley? plz explain

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. asynchronized I/O == multiplexing I/O?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 07-24-2006, 10:06 AM
  2. why page based I/O can improve performance?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 06-12-2006, 07:42 AM
  3. Nonblocking I/O
    By fnoyan in forum Linux Programming
    Replies: 4
    Last Post: 11-29-2005, 03:37 PM
  4. Overlapped I/O and Completion Port :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 10-30-2002, 04:14 PM
  5. WSAAsyncSelect I/O Mode :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 1
    Last Post: 05-12-2002, 03:23 PM

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