Its most likely because of the way Im using. Im using the get subfunc so it will check the whole line instead of just one word, but it doesnt allow using an int variable. I just needed a way to get an int from it, so I think I found it, unless theres a better way :/
Code:
void loadset(const char *filename) {
char* num1=new char[100];
char* num2=new char[100];
char* num3=new char[100];
int numONE, numTWO, numTHREE;
int location[5];
std::ifstream loadline(filename);
loadline>>location[1];
loadline>>location[2];
loadline.seekg(10);
loadline.get(num1, 100, '\n');
loadline.seekg(17 + location[1]);
loadline.get(num2, 100, '\n');
loadline.seekg(24 + location[2]);
loadline.get(num3, 100, '\n');
numONE=atoi(num1);
numTWO=atoi(num2);
numTHREE=atoi(num3);
std::cout<<"Num1: "<<numONE<<std::endl;
std::cout<<"Num2: "<<numTWO<<std::endl;
std::cout<<"Num3: "<<numTHREE<<std::endl;
loadline.close();
}//loadset()
Thats whats there right now. It seems to work well, but it does seem to slow the cout down a bit for some reason. So you know what the file looks like:
Code:
3 5
Num1=376
Num2=29
Num3=2
The numbers at the top tell the program how many extra characters to skip.(Note I did use the >> for the numbers up top cause it seemed easier, but the others Im using like that cause in the accual version I am going to use numbers in some slots, and char in others.)
Note: Thats just to test if its working, currently Im working on an address book like program, and am trying that setup.