| | |
Problem with Turbo C...or so I think!!
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2004
Posts: 7
Reputation:
Solved Threads: 0
I have this recurring (read annoying) problem with Turbo C++. I've a program which uses graphics, and for some reason, the minute I run the program, it exits TC with a dialog box saying:
"This program has performed an illegal operation and has to exit."
The illegal operation on inspection was a general protection fault.
But the frustrating part is, initially when I ran the program, it gave me no problems. When I tried running it the next day, it would keep exiting giving me the error I mentioned above and since then just doesn't work. I tried running it on a friend's PC, doesn't work there either. But it works fine in my college laboratory, and I've no clue how.
I can't figure out if this has to do with my OS or TC itself. Now, basic graphics programs of drawing a line won't work either.
Can someone please help me out here. My program's a standard c++ program which uses a plethora of basic graphics functions like line(), arc() etc.
"This program has performed an illegal operation and has to exit."
The illegal operation on inspection was a general protection fault.
But the frustrating part is, initially when I ran the program, it gave me no problems. When I tried running it the next day, it would keep exiting giving me the error I mentioned above and since then just doesn't work. I tried running it on a friend's PC, doesn't work there either. But it works fine in my college laboratory, and I've no clue how.
I can't figure out if this has to do with my OS or TC itself. Now, basic graphics programs of drawing a line won't work either.
Can someone please help me out here. My program's a standard c++ program which uses a plethora of basic graphics functions like line(), arc() etc.
It sounds suspiciously like a memory problem such as a dangling pointer. They can be incredibly difficult to debug because sometimes everything works fine and sometimes it crashes miserably. Before you blame your system or the compiler, make sure your code is perfect. Otherwise you're showing nothing but arrogance in assuming that you can code no wrong.
I'm here to prove you wrong.
•
•
Join Date: Dec 2004
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Narue
It sounds suspiciously like a memory problem such as a dangling pointer. They can be incredibly difficult to debug because sometimes everything works fine and sometimes it crashes miserably. Before you blame your system or the compiler, make sure your code is perfect. Otherwise you're showing nothing but arrogance in assuming that you can code no wrong.
Like I said my program worked fine. It had numerous calls to line(), arc(), circle() and a couple of other graphics functions. I started to code a new function and when I ran it, it exited. So I used breakpoints to figure out where
the problem occurred. I realised it exited at a call to arc() in my new function.
The sequence of calls being:
line();
arc();
arc();
arc();
It exited at the very first arc() call.
So I commented all the arc() calls following the line() call. The program worked fine. I couldn't figure out what the problem was, so I sent it to a friend to see if he could. But the program didn't work on his PC even if he commented the arc() calls. That was strange, but after some poking around with the program, we decided to leave it at it.
The next day when I try to run my program again, it doesn't run. Whether I comment the arc() calls, comment the whole new function or just use a few line() functions to draw a couple of lines. Nothing works. But other programs in TC not involving graphics, work just fine.
So then I take it to my college laboratory and what do you know, it works-just fine! No crashes at all.
I reinstalled TC, it still didn't solve the problem. Which is why, I was moved to wonder, if it was just TC or my OS. If I don't figure out the problem, I'd have stick to working in college, which can be cumbersome.
I'm sorry for the verbiage, but hope it explains my situation better.
![]() |
Similar Threads
- Problem with Turbo C++ IDE 3.0 (C++)
- Refernce in Turbo C++ (C++)
- Text to Speech. turbo c++ explorer (C++)
- turbo c processor fault (C++)
Other Threads in the C++ Forum
- Previous Thread: unresolved external error upgrading 6.0-7.1
- Next Thread: str error
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






