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. Managed C++/CLI
  4. Read text file line by line.... c++

Read text file line by line.... c++

Scheduled Pinned Locked Moved Managed C++/CLI
c++ioshelptutorial
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.. reg, Subbu

    L M 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.. reg, Subbu

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, aren't you confusing standard C/C++ (see C/C++/MFC forum) with managed C++/CLI (this forum), where string class and File.ReadAllLines() would be useful (and getline is unheard of)? :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      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.. reg, Subbu

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        If I'm not mistaken, geline() is a method - you need to call it on a basic_istream object. Maybe Textfile.getline(Textfile,value);

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        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