Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Getline help

  1. Jun 2, 2008 #1
    Here is the problem, I made up this program and compiled it with the Big CC compiler and it worked perfect, just the way I wanted it to work, however I have to switch compilers and get it to work on an xlC compiler which I am not familiar with, and of course the program compiles but does not work how it was suppose to work.

    The part that is an error, is where I need to 'copy and paste' a infile. I need control of certain elements of the infile so i can do manipulation on them and run a model program, however I still need the rest of the infile for calculation purposes as well, so my thought was just create an outfile, store what I need control of and outfile it, and then outfile the rest of the infile. Then i can make changes to certain elements and sent it through a loop so I would have multiple runs with the data changing only slighly.

    However, what happens now is that I gets through the first run fine, then it fails at the 2nd run b/c it did not copy the infile properly and i get this error

    1525-001 The READ statement on the file ram.in cannot be completed because the end of the file was reached. The program will stop.

    here is the piece of my code acting up

    outFile <<fixed << showpoint << setprecision(1);

    inFile>>junk >>zs >> zr;
    outFile<<inFrequency<<" " << zs <<" " << zr;

    Please help!!!
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted