text editor
Aug 25, 2011 at 4:29pm UTC
I made a simple text editor but I want to get the cursor to move around because once I hit enter.., it's done, cant get back to that line! Here is my code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
#include <iostream>
#include <cstring>
#include <string>
#include <fstream>
#include <windows.h>
using namespace std;
int main(){
char name[50];
int y = 0;
cout << "Hit Enter then CTRL+Z to end your file." << endl << "Name of file (include the file type): " ;
cin.getline(name,50);
system("cls" );
ofstream file(name);
char word[1000];
cout << " <--- Writing space --->" << endl;
while (cin.getline(word, 1000)){
file << word << endl;
y++;
}
return 0;
}
Thanks!
Topic archived. No new replies allowed.