My friend and I are creating a chat program, that writes to a txt file and then refreshes the screen... the problem is it deletes the line when someone inputs something...Bad times...Here is the code we have thus far....:

#include <stdio.h>
#include <stdlib.h>
#include <fstream.h>
#include <string.h>
#include <windows.h>

char input[1000];
char name[12];
int inputFunction();
int refresh();


int main ()
{


printf("What is your nickname?");
cin.getline(name, 12);
return inputFunction();
}

int inputFunction()
{
printf("\nSpeak: ");
cin.getline(input, 1000);
ofstream inputFile ("\\\\AC10-Server\\Students\\AP classes\\io.txt");
if (inputFile.is_open())
{
inputFile << name<<": "<<input;
//inputFile.close();
}
if(strcmp(input, "/exit") == 0)
{
return 0;

}

if (strcmp(input, "/clear") == 0)
{
system("cls");
}


//Begin refreshing the damn screen.
char fileContents[1000];

ifstream file("\\\\Ac10-server\\Students\\AP classes\\io.txt");

if(file.is_open()){
file.getline(fileContents, 1000);
cout << fileContents << endl;
}
else{
cout << "Unable to open file: \\\\Ac10-server\\Students\\AP classes\\io.txt\n";
return 0;
}
Sleep(1000);

return inputFunction();
}


There we go thanks...