I had a problem with my turbo C++ which would close itself after every execution.(Not the getch problem)

After somehow solving this fault and the full screen problem, I tried out a program to check if my C++ is fine. Everything is fine except for the Output screen which seems out of bounds. I tried out the hello world program and the "He" of hello was not seen.

(I am unable to take the screenshot also.)
How to solve this problem ??

I had a problem with my turbo C++ which would close itself after every execution.(Not the getch problem)

After somehow solving this fault and the full screen problem, I tried out a program to check if my C++ is fine. Everything is fine except for the Output screen which seems out of bounds. I tried out the hello world program and the "He" of hello was not seen.

(I am unable to take the screenshot also.)
How to solve this problem ??

Hello,

may I ask which OS system your are running? Vista?

XP SP 2

commented: thank you +1

didn't help I want to solve the output screen problem !

put something, such as getchar(), at the end of main() to prevent the window from closing.

put something, such as getchar(), at the end of main() to prevent the window from closing.

Maybe re-read the question :) I think he said he has already done that part.

I have a tried drawing the problem out.
The output goes out of screen. And it is not my monitor problem. Everything else is right. It is only the output which is out of bounds.

I don't know what's causing it to go out of bounds like that, but I really doubt it's something to do with your code.

I don't know what's causing it to go out of bounds like that, but I really doubt it's something to do with your code.

I AM SURE THE CODE DOESN't matter here....
if you want here it is

#include<iostream.h>

void main()
{
cout<<"Hello";
}

With getch();

I AM SURE THE CODE DOESN't matter here....
if you want here it is

#include<iostream.h>

void main()
{
cout<<"Hello";
}

With getch();

I know.. that's what I said. By the way, don't use void main, use int main, and use code-tags when posting.

I had a same problem and I have to open o/p window every time right after the execution and input part. Note:o/p screen gone only after the input parts are over.

hie ,wen i compile the program it runs and accepts the inputs but its not displaying the output

Dear friends,

I have been trying to run a c++ program on finding odd and even numbers. It displyas no errors and warnings and it runs. But after entering the number, as soon as i press enter, it does not display anything but comes back to the proram part. Please help.

I have problem with turbo c++ compiler that it cannot print output by clicking ctrl+f9 and a DOS box blink every time when I type ctrl+f9.

is up to date error

is up to date error

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
int i,n,d=0,u,sum=0;
cout<<"enter any no."<<endl;
cin>>n;
for( i=n;i>0;i=i/10)
{d=d+1;}
for(i=n;i>0;i=i/10)
{
u = i % 10;
sum = sum + pow(u,d);
}
if(n==sum)
cout<<"armstrong no."<<endl;
else
cout<<"not a armstrong no."<<endl;
return 0;
}

what is the error?
please help
its works fine on turbo c++ but on codeblock!!!!!!!!

First off, please do not resurrect old threads this way; if you have a new question, start a new thread. It is quite horrifying to find that this thread has been restarted at least three times in the previous eight years, even before you did it, which is absolutely ludicrous.

Getting to the problem itself, we would need to see the actual error output from the compiler to have any idea of where the problem lies. I do see at least one problem (the line #include <math.h>, which is using the old-style C header instead of the modern <cmath> which Code::Blocks is expecting - the most widely used version of Turbo C++ predates the 1998 C++ standard by nearly ten years, so much of it was already out of date 20 years ago) but I don't think you would have had to post here to find the solution to that.

Which raises the question, how did you end up using something as ancient as... never mind, I know the answer already. It's because of all the Universities that have refused to change their standardized coursework for over 25 years and end up teaching things from the 1980s as if they were still relevant. It isn't your fault, but it is infuriating to see it come up again and again. Suffice it to say, you should take 99% of what you learned in those courses and throw them out the window as useless for modern programming.

(OK, that's hyperbole - many of the general ideas are still unchanged, but a lot of the details have evolved greatly since the first edition of Turbo C++ was released in 1989. It also depends on the version of TC++ in question, too, though that particular branding for the Borland compiler was discontinued in 1995 (IIRC), so even the more recent versions are now long since obsolete.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.