Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Read Text File line be line....

Read Text File line be line....

Scheduled Pinned Locked Moved C / C++ / MFC
ioshelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    spalanivel
    wrote on last edited by
    #1

    Hi, I want to read Text File line by line and code follows;(with out using the << operator and char buffer) ifstream Textfile; Textfile.open(strFilePath,ios::in); string value; while(!Textfile.eof()) { getline(Textfile,value); } Textfile.close(); When i am compiling the above code it throws the error as error C3861: 'getline': identifier not found, even with argument-dependent lookup How to rectify this error.. Any other sample Code?? reg, Subbu

    P D 2 Replies Last reply
    0
    • S spalanivel

      Hi, I want to read Text File line by line and code follows;(with out using the << operator and char buffer) ifstream Textfile; Textfile.open(strFilePath,ios::in); string value; while(!Textfile.eof()) { getline(Textfile,value); } Textfile.close(); When i am compiling the above code it throws the error as error C3861: 'getline': identifier not found, even with argument-dependent lookup How to rectify this error.. Any other sample Code?? reg, Subbu

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      Did you #include <string>? Also, basic_istream has a member getline(), maybe try using that one?


      You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

      1 Reply Last reply
      0
      • S spalanivel

        Hi, I want to read Text File line by line and code follows;(with out using the << operator and char buffer) ifstream Textfile; Textfile.open(strFilePath,ios::in); string value; while(!Textfile.eof()) { getline(Textfile,value); } Textfile.close(); When i am compiling the above code it throws the error as error C3861: 'getline': identifier not found, even with argument-dependent lookup How to rectify this error.. Any other sample Code?? reg, Subbu

        D Offline
        D Offline
        dybs
        wrote on last edited by
        #3

        Make sure you're including a using namespace std; line as well. Dybs

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups