home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Borland C++

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1325
Discussions: 200,928, Posts: 2,379,144, Members: 246,295
Old October 2nd, 2002, 07:29 PM   Digg it!   #1 (permalink)
Member
 
techteen143's Avatar
 
Join Date: Oct 2002
Location: Rochester, NY
Posts: 478
Borland C++

I have an install of Borland C++ 5.01 and the program runs fine untill I try to run my programs. It compiles and then there is a blank screen that closes itself. In the lower taskbar it says "Process terminated: C:\BC5\Bin\.... I am running win xp pro on a P4 board , could this be a cause?
Thanks
techteen143 is offline   Reply With Quote
Old October 2nd, 2002, 07:43 PM     #2 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,384
check event viewer, every great once in awhile an error is actually logged there

I've also seen a bug in a program crash a compiler as well, so that is something to think about as well.
Do you use any pointers or anything that may violate some memory space it shouldn't?
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
vass0922 is offline   Reply With Quote
Old October 2nd, 2002, 07:48 PM     #3 (permalink)
Member
 
techteen143's Avatar
 
Join Date: Oct 2002
Location: Rochester, NY
Posts: 478
Nothing and it is just a test program

#include <iostream.h>
int main(void)
{
cout << "Test" << endl;
return 0;
}

Had this problem before but don't know what causes it. Could it be something about XP?
techteen143 is offline   Reply With Quote
Old October 2nd, 2002, 08:02 PM     #4 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
It is probably just running and closing.

This used to happen to use back in High school. Try putting a getch(); in there to make it wait for a key stroke. Eitehr that or take some input. Should stay open then.

And welcome to Techimo

Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
jkrohn is offline   Reply With Quote
Old October 2nd, 2002, 08:10 PM     #5 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 563
dangit, jkrohn beat me!!

Ya I had the "run & exit before you see it" thing happen when I did c++ in win98, but in 2k it doesn't do it to me...

we got around it with this little change: (jkrohn's method works just as well too btw, and without having to include a second library ...)
Code:
#include <iostream.h> 
#include <stdlib.h>

int main(void) 
{ 
    cout << "Test" << endl; 
    system("pause");
    return 0; 
}
cheers!

and yes, welcome to Techimo!!

Edit: btw, I'm using Visual Studio, not Boroland, so my suggestion may or may not work... should work tho...
^hyd^ is offline   Reply With Quote
Old October 2nd, 2002, 08:11 PM     #6 (permalink)
Member
 
techteen143's Avatar
 
Join Date: Oct 2002
Location: Rochester, NY
Posts: 478
Thanx It works fine when I take input.
techteen143 is offline   Reply With Quote
Old October 2nd, 2002, 08:20 PM     #7 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 563
oh, also, "cls" - (clearscreen)
I believe borland already has a method for this, but if your ever working with command-line apps in VS C++ and need to clear the screen, system("cls") works nicely...

was gonna mention it in my other post, but forgot...

actually, I think you can do pretty much anything with system() that you can do in a dos prompt... just don't forget to include stdlib for it...

anywho... cheers!!
^hyd^ is offline   Reply With Quote
Old October 2nd, 2002, 08:21 PM     #8 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,384
ohhhh
I thought he meant it was crashing the entire compiler
vass0922 is offline   Reply With Quote
Old October 2nd, 2002, 09:49 PM     #9 (permalink)
Member
 
techteen143's Avatar
 
Join Date: Oct 2002
Location: Rochester, NY
Posts: 478
I have it working now however whenever I hit enter after inputing something it closes, like in this program:

#include <iostream.h>

int main(void)
{
int num1;
cout << "Enter a integer to be determined wheather it is divisible by 27 or 31";
cin >> num1;
if(num1 % 27 == 0) & & (num1 % 31 == 0)
if(num1 % 27 == 0);
cout << "The integer is divisible by 27";
if(num1 % 31 == 0);
cout << "The integer is divisible by 31";
cout << "The integer is divisible by both 27 and 31";
else
cout << "The integer is not divisible by 27 or 31";
return 0;
}

And also I am getting an error for the red line of code "must take address of a memory location" HELP and also how can I get it to display only one of those when it is true. Now if something is divisible by 27 and 31 it prints all three lines. Thanks
techteen143 is offline   Reply With Quote
Old October 2nd, 2002, 09:52 PM     #10 (permalink)
Member
 
techteen143's Avatar
 
Join Date: Oct 2002
Location: Rochester, NY
Posts: 478
sorry messed up the code


#include <iostream.h>

int main(void)
{
int num1;
cout << "Enter a integer to be determined wheather it is divisible by 27 or 31";
cin >> num1;
if(num1 % 27 == 0);
cout << "The integer is divisible by 27";
if(num1 % 31 == 0);
cout << "The integer is divisible by 31";
if(num1 % 27 == 0) & & (num1 % 31 == 0)
cout << "The integer is divisible by both 27 and 31";
else
cout << "The integer is not divisible by 27 or 31";
return 0;
}
techteen143 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2867)
Obama the Muslim (14)
Is the PSU I received dead? (10)
windows vista security holes (9)
HIS HD5770 graphic card question (15)
Print spooler problem (13)
Foreign voltage (10)
Install XP pro and a Vista laptop ?.. (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
A good PSU? (10)
Ideal cheap graph card for PC-Gamin.. (16)
New Computer wont recognize XP disc (7)
EVGA 9800 gtx help with finding a g.. (8)
World's largest Monopoly Game using.. (331)
Recent Discussions
Ideal cheap graph card for PC-Gaming? (16)
Regular Build (2)
Graphics Card Upgrade Question (0)
Fire in DVD (2)
Modern Warfare For the PC (33)
radeon x850xt platinum & shader 3 (3)
Have you switched yet? (84)
Install XP pro and a Vista laptop ?? (10)
Wireless Router+Cable Modems and Much.. (0)
Optical Audio A-B Switch (1)
windows vista security holes (9)
The NTDVM CPU has encountered an ille.. (24)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (34)
Wireless speakers for PC? (11)
Print spooler problem (13)
Help getting around port 80 for camer.. (2)
Display shows 3x5 inch in middle of s.. (3)
monitor will not turn on at all, (1)
World's largest Monopoly Game using G.. (331)
Foreign voltage (10)
FiOS modem/router interfering with ne.. (7)
Browsers wont load websites (2)
Virus Doctor Popup? (1)
Dept. of HS: NSA 'Helped' Develop Vis.. (15)
EVGA 9800 gtx help with finding a goo.. (8)


All times are GMT -4. The time now is 03:30 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28