//create the memory file fstream memory; memory.open("memory/memory.txt", ios::in); //then write your own phrases and responses : //user's phrase memory << "Hi" << endl; //machine's response memory << "hi" << endl; //phrase memory << "How are you?" << endl; //response memory << "I'm doin just fine, thanks. Yourself?" << endl; //etc.