ReadLine()...refreshers???

This is a discussion on ReadLine()...refreshers??? within the C++ Programming forums, part of the General Programming Boards category; I totally forgot how to use readline(). I'm looking it up on the MSDN right now but it's got all ...

  1. #1
    Registered User verbity's Avatar
    Join Date
    Nov 2006
    Posts
    101

    ReadLine()...refreshers???

    I totally forgot how to use readline(). I'm looking it up on the MSDN right now but it's got all the Environment::Console...blah blah blah.

    I'm working on a parser that: has a szBuffer[1024] that reads in 1024 bytes from the file and then parsers it. I just haven't done this in a while. Just a simple Readline(from file) example would be greatly appreciated.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    What language are you using that has ReadLine in it? Is this C#? C++/CLI? I have a feeling I'm looking at the same MSDN page you are; is it this one? If so, I have no idea how I could write something simpler than "sr->ReadLine()".

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    137
    You can use iostream's "getline" in the form of getline(filehandlestream, buffer);
    Or you can just read a whole file and separate by \n (or \r\n) using a C++ split/explode function.
    ★ Inferno provides Programming Tutorials in a variety of languages. Join our Programming Forums. ★

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to handle long lines using GNU readline?
    By rfk in forum C Programming
    Replies: 4
    Last Post: 08-19-2008, 12:04 AM
  2. change readline prompt
    By cstudent in forum C Programming
    Replies: 1
    Last Post: 04-19-2008, 11:00 AM
  3. ReadLine to int
    By DaveHope in forum C# Programming
    Replies: 2
    Last Post: 01-27-2006, 10:19 AM
  4. Using readline library with lex/yacc
    By jwong78 in forum C++ Programming
    Replies: 0
    Last Post: 10-28-2005, 06:18 PM
  5. Interacting with other programs with readline
    By Provost in forum C Programming
    Replies: 1
    Last Post: 08-13-2004, 07:24 AM

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