I/o

This is a discussion on I/o within the Game Programming forums, part of the General Programming Boards category; I just wanted to see some of the better ways for i/o. I only know how to do the <IOSTREAM> ...

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

    I/o

    I just wanted to see some of the better ways for i/o. I only know how to do the <IOSTREAM> and <fstream.h> commands. Is there a way where u could store an integer and other stuff and go strait to the integer and retrieve it or to somehow put a pointer to that spot in the file?
    if(you.control(own.life())==true)
    {...}
    else
    {
    someone.else();
    will()
    }

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    intresting!? can u please explain further

  3. #3
    _ Munkey01's Avatar
    Join Date
    Dec 2002
    Posts
    280
    Use function parameters, global variables (don't use these unless there is NO other way), or creating a class (try to use accessor functions instead of making the member variable public). These are just the ones I know of.

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

    Post Better Explanation

    I want to be able to store a string, integer, etc... without having to do something like this to find a certain spot and then read from that spot.
    Code:
    ...
    char c;
    string s;
    ifstream F("name.txt");
    for(int i = 0;c!='spot1';i++;)
    {
    F.get(c);
    }
    s=F.getline;
    ...
    Is there a way to do that?

    P.S.
    I dont care if the code above has errors or not
    if(you.control(own.life())==true)
    {...}
    else
    {
    someone.else();
    will()
    }

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

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