problems with-chat system
hey, I''m havoing a problem with my program. I decided to make a chat system till I fully learn how to game program. Well, it works okey except for one thing. I''ll get to that in a minute.
Heres the code: #include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main(void)
{
string lockver2 = "[forum=locked]";
char lockver[20];
ifstream lock("lkfile.lock");
lock >> lockver;
lock.close();
while(lockver == lockver2)
{
cout << "Sorry, chat system is locked." << endl;
Sleep(1000);
return(0);
}
char ofile[240];
char nfile[240];
string nfile2 = ofile;
string nfile3 = nfile;
ifstream o_file("log.lfrmd");
o_file >> ofile;
o_file.close();
Sleep(1000);
ifstream n_file("log.lfrmd");
n_file >> nfile;
n_file.close();
if(nfile2 == nfile3)
{
char chat[120];
ifstream chatsys("log.lfrmd");
chatsys >> chat;
chatsys.close();
cout << chat << endl << endl;
Sleep(2000);
return(main());
}
else
{
return(main());
}
return(main());
} I''m trying to get it where it will just display whats in the log if it changes. Not just keep going: testing
g
f
and soforth. Any ideas how to get it where it will just change it if I make modifcations to the log?
thanks,
Demon Realms!!!!!!!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement