Automatic downslash on console display

I am writing a c++ program that using console display like a notepad.
The program gets text from user on console , keeps it in double linked bi-directional linked list. Then displays the text on console.
But the problem is the size of the text to be written on the console screen must be limited. The text written by the user on console have to line up automatically after 100 characters(example).
Here I wrote function that display the text on console.
And the struct that keep the string(text).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 void show(){

temp = first;


gotoxy( 0 , 0  );//brings cursor the top on console
while(temp != NULL){
printf("%s\n", temp->name);
temp = temp->next;
}
temp = end;
}

///////////////////////////

struct Text{
    string name[100];
    Kayit *next, *prev;
};
struct Kayit *first, *end, *temp;

////////////////////////////
Last edited on
Topic archived. No new replies allowed.