Hi, I'm having trouble opening my file in visual studio. The fexists function returns true, but when gets to the loading in the file it gives me the following error: invalid NULL pointer. When debugging, it says error reading characters from string. The file in notepad looks like this: "1#2#3#4". Can anyone see a reason why this is occurring? Thanks!
int poundpos[12];
// ...
int length = 20;
// ..
for(i = 0; i < length; i++)
{
getline(liness, temp, '#');
temp1 = stoi(temp);
temp1 = poundpos[i]; // 1. what happens if i>11 ?
// 2. where does poundpos[i] ever get set ?
// 3. you set temp1 ... but overwrite it right away
add = poundpos[i] + add;
}
Bookmarks