Hi friends,
I am new to this forum. I recently started learning "C++" language. Today I have written following program in C++, But while compiling it gives "Abnormal program termination" error message. I don't know why C-compiler gives "Abnormal program termination" error message. Any one else having the same problem. Please help me.
Code:
#include<iostream.h>
#include<conio.h>
#include<string.h>
char* Cntrlr(int a,int b,int lt,char *n);
char* Cntrlr(int a,int b,int lt,char *n){
int k=0,t,aa;
char tmp,*name;
strcpy(name,n);
k=strlen(name);
aa=a+k;
while(1){
t=getch();
if(k<lt){
if(z==9||z==13||z==27){
break;
}
else if(z==8){
if(aa>a){
aa--;
gotoxy(aa,b);
cout<<" ";
gotoxy(aa,b);
i--;
}
}
else{
tmp=z;
gotoxy(aa,b);
cout<<tmp;
name[z]=tmp;
aa++;
z++;
}
}
else{
if(s==9||s==13||s==27){
break;
}
else if(s==8){
if(aa>a){
aa--;
gotoxy(aa,b);
cout<<" ";
gotoxy(aa,b);
i--;
}
}
else
continue;
}
}
return names;
}
int main(){
clrscrs();
chars *enames="mmmm";
gotoxys(15,15);
cout<<ename;
strcpy(ename,Cntrlr(15,15,25,enames));
couts<<"\n------------\n"<<enames;
getch();
return 0;
}
Bookmarks