Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. tkjordantk

    ifstream spits out error, but read is working ??

    After some further investigation, I've discovered this throughout the I/O section. The book says that in the following code, the first "!finout.good()" checks to make sure there were no errors when reading the file. The second one is to make sure there were no errors when the file is closed...
  2. tkjordantk

    ifstream spits out error, but read is working ??

    Thanks, that makes sense to me. The book I'm using as a reference has this setup in multiple examples, Herb Schildt's C++ Programming Cookbook.
  3. tkjordantk

    ifstream spits out error, but read is working ??

    The following code works as expected. It reads data from the input file into the array and displays the array. The problem is that my error checking mechanism "if(!fin.good())" is executing and I'm not sure why... The file I'm reading from is a simple plain text file (formatted data) with: 5...
  4. tkjordantk

    search and replace ":"

    My conditionals were definitely the problem. I decided to get rid of the them, don't really need them like you said. Thanks!
  5. tkjordantk

    search and replace ":"

    I've been trying to replace a ":" with "X" using tr. With the code: if ( index( $test_string, ":" ) == -1) { $test_string =~ tr/:/X/; } I'm sort of new to perl, I was thinking that maybe it was a special character, so I tried to using "\", but that didn't work. Any ideas? Thanks.

Part and Inventory Search

Back
Top