Borland C++ Compiler 3.0 problem

chibicitiberiu

New Member
I'm using the Borland C++ 3.0 compiler, but I have some sort of weird problem: after the execution of the compiled program the application crashes without any warning/error message, just the window disappears. Why does that happen? Can that be caused by the code?
I also tried a step-by-step debugging and after executing the last line of the code ("return 0;") the application crashes.
The weird thing is that it is not for all programs, just some. Why is that? Is there any fix?
 
Are you sure it's the application crashing? return 0; in the programs main execution line indicates that the program has finished normally and if you are running in windows it will close the cmd window it opened. If you are looking for some program output open a cmd window yourself and run the program manually or call system(pause); before return 0;.
 
Are you sure it's the application crashing? return 0; in the programs main execution line indicates that the program has finished normally and if you are running in windows it will close the cmd window it opened. If you are looking for some program output open a cmd window yourself and run the program manually or call system(pause); before return 0;.

Yes, because normally after the execution of the program it should go back to the Borland C interface for further editing or whatever.
But in this case, the window closes. All I can do to stop it from exiting and eventually loose the modified code if not saved is to put a "getch();" before "return 0;" and when it reaches that getch use CTRL+BREAK.

But I want it to work normally.
 
I haven't used Borland C++ and I haven't seen anything like that before. When you say
Yes, because normally after the execution of the program it should go back to the Borland C interface for further editing or whatever.
But in this case, the window closes.
Do you mean that Borland C++ closes as well?
 
I have no idea then. Does Borland still support C++ 3.0? You may have to go directly to them. It sounds like a bug with their IDE.

If you are just developing console applications DevC++ isn't fantastic but it's ok. http://www.bloodshed.net/devcpp.html It hasn't been updated in a long time though.
 
Out of curiosity, does borland also close if you make a new program and just return 0 from it?
 
Out of curiosity, does borland also close if you make a new program and just return 0 from it?

No, this happens only with some programs for an unknown reason, and pretty rare. I also encountered it after returning a value from a function, not just after finishing the execution of a program.
 
Now I'm really going nuts with this program. Another problem started appearing:
Code:
char* stringsum(char* string1, char* string2)
{
	int i,l;
	char* send;

	for (i=0;string1[i]!=0;i++)
		send[i]=string1[i];

	l=i;
	for (i=0;string2[i]!=0;i++)
		send[l+i]=string2[i];

	return send;
}
This function works like the strcat function (which apparently doesn't work, just like this one ^^)
The problem is that here: for (i=0;string1!=0;i++) send=string1; it doesn't just write in the 'send' variable, but it writes in the 'string2' variable and I loose it.

For example: string1="Hello"; string2="Welcome";
After the execution of the first for: string1="Hello"; string2="Hello"; send="Hello";
And it enters an infinite loop at the second for and gives an "Abnormal program termination".

I believe that it got some sort of disease like the 'mad cow disease' or something causing all these problems.

Seriously, though, I thing it fails to assign the memory addresses correctly.
 
Back
Top