there was no problem compiling, but the program crashed instantly
i narrowed it down to the getline function
it had been working flawlessly before and the code i added should not have interfered with it
i stripped the code down as much as i could until all that was left was this below
it's not meant to do anything ofcourse, just to show what's wrong
i'm sorry if it's just a stupid mistake but i can't see anything wrong
#include <iostream>
#include <fstream>
using namespace std;
string read;
string search()
{
ifstream myfile ("myfile.txt");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,read);
}
}
}
int main()
{
while(1==1){
search();
}
}

New Topic/Question
Reply




MultiQuote




|