I need a part of my program to read an integer value from a text file (there's nothing else in that file) and assign the found value to a number. That number (bookspan) is not a member of a class...is this operation possible? I've written part of the code, but cant understand what to put in the critical part.
Code:int bookspan; int main() { Entry e[bookspan]; ifstream readspan; readspan.open("span.txt", ios::in); while(!readspan.eof()) { readspan.seekg(0); bookspan=bookspan; //Oh wait, that doesn't make any sense... readspan.close(); } cout<<"\nBookspan is "<<bookspan; cin>>bookspan; //Makeshift 'pause my program' line return 0; }