Home › Forums › C Programming › C++ abrupt termination
- This topic has 8 replies, 3 voices, and was last updated 16 years, 8 months ago by deepaksancheti.
- AuthorPosts
- March 11, 2008 at 6:53 am #2074DeepakParticipant
heyyy geeks…
i m a learner in OOP C++ programming…
d problem dat i m facing is the abrupt termination of C++ when i execute a program…let me explain in detail..wen
i run a program..sometimes it runs well and fine without any problem…but
wen i exit the program the TC.exe terminates abruptly ….(it also happens at time wen a fatal error occurs..however its natural… <)i thnk d reason behind mite be like dis : during d program execution…somehow d memory location of TC.exe mite be getting overwritten by some or d other component of d program…however dis is my guess…sooo…is there none who can help me out here ??? i want a perfect reason and a solution to that….- This topic was modified 3 years, 9 months ago by M. Saqib.
- March 11, 2008 at 10:23 am #3347deepaksanchetiParticipant
Same problem with me guyz…………………
I think the reason is proper that the TC gets overwritten but how to overcome this problem?????
Help us as soon as possible………
- March 11, 2008 at 5:42 pm #3348msaqibParticipant
What operating system are you using?
I worked on Win 98, 2000 and XP. turbo C/C++ compiler has no problems while using on win98. But if you write code which try to directly access any I/O port like COM port, then it causes problems. Because win 2000 and XP has some restrictions on accessing these resources.So if this is causing the problem for you…then I would advise you to use either win98 or change your program in a way that can safely access I/O devices.
Or you could explain any situation when your program crashed, was that TC.exe file itself or you were trying to compile and run any program on TC?
- March 12, 2008 at 8:59 am #3349msaqibParticipant
Hello
I have jsut compiled and run your program, and it works fine with me. I am using the same version of borland turbo c compiler on windows XP. It didn’t give me any errors or warning message and the program remained stable. Turbo C neither crashed nor closed with or without any warnings.
What operating system do you use?Note:
@Encrypted wrote:dis is my code…
now wen i run it, it runs well nd fine…widout ne problems…
but as sun as i exit it…instead of returnin to TC compiler, it jsts exits to d windows…
soo…now if u hav gotta time for it…den pls check it out…
nd giv me a reason nd solution…nd yaaa…i m using a Borland Turbo C compiler of version 3.0….thot it mite help u…
Please read the forums guidelines, as people would not understand this language, it looks like some sort of chatting language :P
But I would advise not to use it because it looks a bit odd and one can’t understand it easily. - March 12, 2008 at 9:18 am #3350DeepakParticipant
heyyy….thnx for advice bro… i wont use dem now onwards… :)
nd i m usin windows XP SP2 ….
hwever it ddnt wrk even in windows 2000 …
nd 1 more thng…u r sayin its wrkn fine thru ur compiler….
but i hav already run d code in 2-3 pcs…wid d same result…
hw cm it workd in urs..?? nd wat abt ur OS ??
nd wat has OS to do wid dis.?? - March 12, 2008 at 9:24 am #3351DeepakParticipant
nd d message i m gettin is smthng like dis :
16 bit MS-DOS Subsystem
Turbo C++ IDE
The NTVDM CPU has encountered an illegal instruction.
CS:0066 IP:e5ea OP:f0 0b a8 09 00 Choose ‘Close’ to terminate the application.d register values changes at times…
c if u get sm hint… - March 12, 2008 at 9:25 am #3352msaqibParticipant
Hello
Well it’s quite strange then, because I am using the same compile, OS version. Do you exit the program when you press ‘0’? And then press Enter kay to exit the program?
I did the same thing, it worked fine here…
May be anyone else might help you out here. For me this program works fine.
I did not talk about smilies in the post, infact they are to show the feelings. I am talking about the language like
@Encrypted wrote:
nd i m usin windows XP SP2 ….
hwever it ddnt wrk even in windows 2000 …
nd 1 more thng…u r sayin its wrkn fine thru ur compilerYou could have written it like
and i am using windows xp SP2
How ever it did not work even in windows 2000…
and one more thing..you are saying its working fine through your compilesThis way it looks quite readable.
Thanks
- March 12, 2008 at 9:46 am #3353msaqibParticipant
Hey
Yes I got the same error, this is not the compiler or OS error. Actually the variable choice in your program is of type int. And you use that variable to get the input from the user to make the decision and navigate through the menu. So now the problem is when enters character instead of an integer value, it crashes your program.So the solution to your problem is that you will have to check this input first, whether the choice is of type integer or character. If its of character type then ignore it, as you are doing cin.ignore(); but you will have to implement it properly. As cin.ignore(); ignores characters only.
- March 12, 2008 at 10:17 am #3354deepaksanchetiParticipant
Assalamualaykum Mohammed Saqib….
This is not the problem i think…. The Bhoot and I work together in a same institute…. Its also the same case with Char type choice i/p…
So i think there must be something else behind this cumbersome problem.
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.