zadeh79
02-26-2007, 04:51 PM
Thnx to all who have helped me so far. Apparently, OGL can handle files, as I was told. However I am having a bit of trouble testing the contents of a line.
When I attempt to test the 'buffer' variable in the following code, it does not pass. Can someone please aid in explaining why? The line contents is printing to the screen just fine but I am not getting the "data confirmed" printed as should be.
const int MAX = 6;
char buffer[MAX];
ifstream input("test", ios::in);
input.getline(buffer, MAX);
cout << buffer << endl;
//THIS IS WHERE I AM HAVING TROUBLE
if (buffer == "hello")
{
cout << "data confirmed";
} GAME IMAGE (http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&friendID=119651032&albumID=0&imageID=3727757)
When I attempt to test the 'buffer' variable in the following code, it does not pass. Can someone please aid in explaining why? The line contents is printing to the screen just fine but I am not getting the "data confirmed" printed as should be.
const int MAX = 6;
char buffer[MAX];
ifstream input("test", ios::in);
input.getline(buffer, MAX);
cout << buffer << endl;
//THIS IS WHERE I AM HAVING TROUBLE
if (buffer == "hello")
{
cout << "data confirmed";
} GAME IMAGE (http://viewmorepics.myspace.com/index.cfm?fuseaction=viewImage&friendID=119651032&albumID=0&imageID=3727757)