0

ifstream error

so, I've written programs using ifstream in the past, successfully. yet this time, I can't seem to correct this "cannot read characters from string" error shown in the image. I basically declare ifstream inputFileStream in the class header, then try stating inputFileStream("text.txt"); and I already have that given error in the debugger.

More specifically, I construct an instance of the given class in the main method, and call (from the main method,) the public method which contains the statement inputFileStream("text.txt");.

I've made sure that the given text file is actually in the same folder as the project. Anybody familiar with this error?

I looked up the cccccccc error code and it has to do with an uninitialized stack something, but why would that be relevant to this?

The closest post to this was here, but im still trying to decipher the problem How to end up with a pointer to 0xCCCCCCCC

Community
  • 1
  • 1
squirrelsareduck
  • 874
  • 1
  • 10
  • 15

1 Answers1

0

so, I got it working. I'm using visual studio 2013. all I had to do was copy the code into a new project, and compile it there. no idea why this worked as such

squirrelsareduck
  • 874
  • 1
  • 10
  • 15