#include <stdlib.h>
#include <iostream>
#include <string>
#include <fstream>
#include <windows.h>
using namespace std;
int main()
{
ifstream fin;
string szName = "";
int health=0, gold = 0;
fin.open("Stats.txt");
if(fin.fail())
{
cout << "ERROR: Could not find .txt file!\n";
return 0;
}
cout << endl;
while(fin >> szWord)
cout << szWord;
}
I get this error C:\outputprogram.cpp(22) : error C2065: 'szWord' : undeclared identifier
how should i change it
thanks in advanced