Hello again. It seems we have been going around in circles, but I guess your last post has answered my question. Yes, the compiler is indeed an "old fossil", but it seems to be the only compiler I...
Type: Posts; User: sundeeptuteja
Hello again. It seems we have been going around in circles, but I guess your last post has answered my question. Yes, the compiler is indeed an "old fossil", but it seems to be the only compiler I...
Hello again. Actually my problem really appears to be independent of the source code. The fact is that the same executable when running under DOS gives different results from those that come when the...
Hello everyone. I had created a program to simulate the motion of a projectile. My problem is that when I run the program under Windows, I get less accurate results than when I run it under DOS. Why...
Hello. I have been trying to create a program to concatenate two strings using operator overloading for a class STRING. The output I get consists of random characters. Please tell me why this should...
Thanks max_unreg. That explanation helped a lot.
/*
Program to study constructors using inheritance...
*/
#include<iostream.h>
#include<conio.h>
class base1
{
int x;
public:
base1(){}
Thank you, that was helpful. So what you are basically saying is, the input for getch will always appear as the input for gets, in this case. Now for the next question, is there any way to prevent...
This is quite interesting. It is definitely happening on Dev C++ and Borland C++. Perhaps the following code will help...
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int main()...
I'll try to explain exactly what is happening.
First the statement is
choice=char(getch()); There is no output at this stage.
Now, the statement executed is cout<<choice<<endl; Assume that the...
But why should it appear twice? That is what is happening. Please try executing the code posted, you'll see what I mean.
Consider the following program. Why is it that when the statement gets(str) is executed, the character pressed earlier automatically appears on the screen? Furthermore, is there a way to prevent...
Thanks Sang-drax, that did the trick. I will try to figure out how exactly the code works soon enough.
Hello everyone. Is there a time delay function defined in ANSI/ISO C++, perhaps similar to sleep() or delay() of Borland C++?
I guess so. However, the help file in Turbo C++ v3.0 said that getch (and getche) are unique to DOS. Howcome?
Correct me if I am wrong, but isn't getch unique to DOS?
Which is the best free IDE designed to work with the Borland C++ 5.5 Compiler?
I believe graphics.h is needed for BGI graphics, which are not supported under Windows. They need to be used under DOS. Probably a DOS based version of Turbo C++ would work. You can get v1.01 at :...
A simple question, which is the best free C++ Compiler, which comes with its own IDE? Also, where can I download it?
Create an array of strings for the number of words present in the sentence. Use any standard sorting method of sorting the array of strings, and then concatenate them using strcat().
Alternatively you can use fabs() defined in math.h, which has been created specifically for floating point arguements.
Try this...
/*Compiler : Turbo C++ v3.01*/
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#define MAX 50
int main()
{
Two functions of dos.h, delay and sleep suspend the execution of the program for a specified time interval.
void delay(unsigned milliseconds);
void sleep(unsigned seconds);
Compiler : Turbo...
Unfortunately the header files/libraries are usually provided as part of the compiler. I doubt that the header file created for Borland C++ will work with MSVC++(I used to think like you at one time...
I believe the functions sound(), nosound() and delay() are available only with Borland compilers. You can get the free Borland compiler here : http://www.borland.com
Perhaps you can try using dynamic memory allocation using the new operator and pointers.