Thread: I/o

  1. #1
    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
    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
    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, 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, 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, 03:23 PM