Archived

This topic is now archived and is closed to further replies.

problems with-chat system

This topic is 5376 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!!!!!!!!

Share this post


Link to post
Share on other sites