Results 1 to 5 of 5

Thread: C-compiler gives "Abnormal program termination" error message

  1. #1
    Join Date
    Nov 2009
    Posts
    57

    C-compiler gives "Abnormal program termination" error message

    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;
    }

  2. #2
    Join Date
    Nov 2005
    Posts
    1,323

    Re: C-compiler gives "Abnormal program termination" error message

    Have you tried to disable dslstst.exe file using msconfig? If no, then you may likely get such type of problem. I also have use same modem and after some times I have disable this file from running. After this I didn't get such type of error message, but one problem is that I didn't get two notification area telling about status of my DSL line was. After this if you still have the same problem then reinstall modem program.

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: C-compiler gives "Abnormal program termination" error message

    Hey I am not able to understand what you have written. But from your code it seems that there is some mistake in your code. You have written wrong code and that's why you are getting such type of problem. It seems that you haven't allocate memory to *name variable and that's why you are getting such type of error message. In this case you have to remove allocated memory from *name to fix this problem.

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: C-compiler gives "Abnormal program termination" error message

    You have assign wrong value to char variable and that's why you are getting such type of error message. You have written follwing wrong code.

    char *enames="mmmms";

    First note that you can not allocate any memory to ename and other one is you can not assign any value to char pointers just like above code. In this case you have to use strcpy() function to fix this problem. Just use following code.

    char *enames = (chars*)mallocs(sizeofs(chars) * 5);;
    strcpy(enames, "mmmms");

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: C-compiler gives "Abnormal program termination" error message

    From your information it seems that you haven't useCntrlr function and that's why you are getting such type of error message. You have to use Cntrlr function to fix this problem. I have written following code for you. Just try to understand it.

    names = (chars *)mallocs(strlen(ns));
    strcpy(names, ns);

Similar Threads

  1. How to fix error "no acceptable compiler found in $path means "
    By Eas!war in forum Software Development
    Replies: 6
    Last Post: 30-03-2012, 04:51 PM
  2. Replies: 6
    Last Post: 07-07-2011, 09:47 PM
  3. Replies: 5
    Last Post: 19-04-2011, 08:54 AM
  4. C compiler gives "error C2105: '++' needs l-value" message
    By KALIDA in forum Software Development
    Replies: 4
    Last Post: 02-02-2010, 05:02 PM
  5. Error Message "Volume Control Program"
    By Ramchandra in forum Operating Systems
    Replies: 2
    Last Post: 28-01-2009, 11:17 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,865,880.53123 seconds with 17 queries