Original Post
I hope someone can help with this. This copies the txt file just fine as long as there are 8 letters or less. Any more than 8 causes "the memory could not be read" windows error. is there a better technique to filling a dynamic char array? Thanks to anyone that can help here.
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
class TestChecker
{
public:
TestChecker();
private:
ifstream getFile;
char *answerKey;
};
TestChecker::TestChecker()
{
getFile.open("test_results.txt");
if( getFile.is_open() )
{
getFile >> (answerKey = new char);
cout << answerKey << endl;
}
getFile.close();
}