void typing()
{ int i=0;
char *p=new char[2000];
step1 : int row=2 ,col=1;
while(ch!=19)
{
gotoxy(col,row);
step2: if(col==79)
{col=1;row++;}
else if (row==24)
goto step1;
int a;
ch=getch();
if(ch == 0)
ch = getch();
a=ch; // To convert character to its ascii code
switch(a)
{
case 13 : row=row++;col=1; // case for press enter for next line
gotoxy(col,row);
ch='\n';
break;
case 8 :
if(col==1) // case for backspace
{row--;col=78;}
else
{col--;
cout<<" ";
i--;
}
continue;
case 9 : col=col+8; // case for tab function
if(col>79)
{row++;col=col-79;
}
continue;
case 72 : row--; //upper arrow key
continue;
case 77 : col++; continue; //right arrow key
case 75 : col--; continue; //left arrow key
case 80 : //down arrow key
row++;
continue;
case 14 : clrscr(); //to creat new file ctrl+n
cout<<"Enter File`s Path ";
gets(s);
newfile(s);
starting();
break;
case 15 : clrscr(); //to open existing file ctrl+o
cout<<"Enter file`s path to be open :" ;
gets(xs);
starting();
openfile(xs);
continue;
case 11 : clrscr();
gotoxy(20,3);
cout<<"~`~`~`~`~ HELP PORTION ~`~`~`~`~";
gotoxy(20,4);
cout<<"Following Are the Keys Used in My-Note PAD : ";
int za=10;
for(int i=0;i<46 ;i++ )
{
gotoxy(za,5);
cout<<"=";za++;}
za=6;
for(i=0;i<15;i++)
{gotoxy(10,za);
cout<<"|"<<endl;
gotoxy(13,6);
cout<<" 1-To Open File Press ( ctrl + o ) ";
gotoxy(13,8);
cout<<" 2-To create New File Press(ctrl+n) " ;
gotoxy(13,10);
cout<<" 3-MOve Arrow keys (up,down,right,left)" ;
gotoxy(13,12);
cout<<" 4-Back Space ";
gotoxy(13,14);
cout<<" 5-Save File(ctrl+s)";
gotoxy(13,16);
cout<<" 6-Enter For new line ";
gotoxy(13,18);
cout<<" 7-Enter ctrl+q(Quit)";
gotoxy(13,20);
cout<<"Press any key to Go back " ;
getch();
clrscr();
starting();
continue;
case 17 : clrscr();
gotoxy(24,6);
cout<<"Thank You For using PIcs-soft Word ";
cout<<endl;
gotoxy(24,8);
cout<<"Have A NIce Time ";
getch();
exit(0);
}
cout<<ch;
p[i]=ch;
col++; i++;
p[i]='\0';
}
clrscr();
cout<<"enter path where you want to save the file ";
gets(ys); int j=0;
ofstream f1(ys,ios::out);
while(p[j]!='\0')
{f1.write((char*)&p[j],sizeof(p[j]));
j++;}
f1.close();
delete [] p;
exit(0);
#include<dos.h>
#include<process.h>
#include<string.h> // for various functions of strings like gets or puts
#include<fstream.h> // for files
#include<stdio ...
what compiler are you trying to use? The code posted is very old and probably not compile with a modern compiler.