reading contets of file line by line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • natrajbio
    New Member
    • Apr 2007
    • 1

    reading contets of file line by line

    Hello friends
    i want to read the contents of file line by line

    how i can do that
  • Extremist
    New Member
    • Jan 2007
    • 94

    #2
    Code:
    getline(filename,lineoffile); //filename is the name of your file
    
                                           // lineoffile is the line of the file you want to read
    See if it works

    Comment

    • thoang36
      New Member
      • Apr 2007
      • 1

      #3
      Hello There,

      I have a question regarding how to read the input from the text file, the calculate it and then write to the order text file as below:

      China USA $15.00 $25.00 $35.00

      Comment

      • Savage
        Recognized Expert Top Contributor
        • Feb 2007
        • 1759

        #4
        Originally posted by thoang36
        Hello There,

        I have a question regarding how to read the input from the text file, the calculate it and then write to the order text file as below:

        China USA $15.00 $25.00 $35.00
        It's a bit rude to ask question in someone else thread.

        But,becasue it's on the same problem maybe we can answer u.

        What have u tryed?
        How does input file looks like?
        Have u any experiance in file reading?
        Do u know the basic algoritham for it?

        In order for us to help u and therfore to help OP ,which has nearly the same problem, u must first help us by answering to those questions.

        P.S:Don't post question in someone else thread in future becasue probably u will not get a answer.

        Savage

        Comment

        • Savage
          Recognized Expert Top Contributor
          • Feb 2007
          • 1759

          #5
          Originally posted by Extremist
          Code:
          getline(filename,lineoffile); //filename is the name of your file
          
                                                 // lineoffile is the line of the file you want to read
          See if it works
          Just in case that OP don't know:

          This all must be in a while loop which will loop until EOF.And lineoffile must be a array to store all that data.

          Savage

          Comment

          Working...