int main()
{
//declare constants and variables
const int MAXLENGTH = 35;
char filename[MAXLENGTH] = "test.txt";
long offset;
int num_chars;
ifstream inFile;
//open file and test for success.
inFile.open(filename);
if (inFile.fail())
{
cout << "\nERROR Opening: " << filename << endl;
system("pause");
exit(1); //EXITS PROGRAM
}
//get offset and number of characters
cout << "Please choose the offset: ";
cin >> offset;
cout << "Please enter how many characters to read: ";
cin >> num_chars;
First of all, your program has "test.txt" not "text.txt"
In case that was just a typo on your part, have you confirmed that the file is indeed in the working path of the program? Perhaps try using an absolute path name.
Check the file permissions - can you open it using a text editor?
Finally, please format your code when posting, it does help.