#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
#include <conio.h>
#include <stdio.h>
usingnamespace std;
//C:\\Documents and Settings\\All Users\\Documents\\crc\\
ifstream file_exists(constchar * filename)
{
ifstream file(filename);
return file;
}
void del(){
remove("C:\\Documents and Settings\\All Users\\Documents\\crc\\con.txt");
remove("C:\\Documents and Settings\\All Users\\Documents\\crc\\mes.txt");
remove("C:\\Documents and Settings\\All Users\\Documents\\crc\\title.txt");
}
int main(){
while(1){
if (file_exists("C:\\Documents and Settings\\All Users\\Documents\\crc\\con.txt"))
{
ifstream title,mes;
title.open("C:\\Documents and Settings\\All Users\\Documents\\crc\\title.txt");
mes.open("C:\\Documents and Settings\\All Users\\Documents\\crc\\mes.txt");
string ti,me;
getline(title,ti); getline(mes,me);
del();
mes.close();
title.close();
MessageBoxA(NULL,me.c_str(),ti.c_str(),MB_OK);
} // End of block
elsecontinue;
} // End of while loop
} // End of main()
If you will notice, its only supposed to display a message when "(file_exists("C:\\Documents and Settings\\All Users\\Documents\\crc\\con.txt"))" but instead, it pops up a message constantly.