Why does the following code, when run, give an access violation? I've looked at it with the debugger, and leading into the strcpy instruction everything looks as it should... :confused:
int...
Type: Posts; User: DarkDragon
Why does the following code, when run, give an access violation? I've looked at it with the debugger, and leading into the strcpy instruction everything looks as it should... :confused:
int...
Thanks, but I'm still confused... But in the article you're dealing with numbers that clearly are distinct, ie their significant figures are different. But here, 1.0 and num have identical digits......
:rolleyes:
1. Regardless of what ANSI may think, main returns whatever you declare it to return.
2. The reasons for returning an int (DOS and its return codes, shells, and purely sequential...
#include <iostream.h>
void main(void)
{
double num=0;
for(int i=0; i<10; i++)
num += 0.1;
if(num==1.0)
cout << "Final number is 1";
else
Yes, programs (especially Windows ones) require a ton of overhead, even if the actual program you wrote is very short. If you have unnecessary #includes, by all means get rid of them, but otherwise,...
You know, there's an edit button for when you want to fix typos without double posting...
My guess would be you need a comma between o and Currency&.
Why?
According to my compiler and profiler, cout is on average 5.75 milliseconds faster than printf. So much for that argument...
B is inversely proportional to A. So
B=C/A.
Is there any way to transfer execution to another program from within yours? In DOS? Windows? I have a feeling I've seen a standard C library function that does this, but don't remeber it. :(
Thanks.
Sure.
First, don't forget to #include <iostream.h> at the beginning of your program if you want to use cout/cin.
Second, lose the data type keywords when calling functions. That is, write...
Sorry, but I'm very confused...
I'm assuming the case 1: is part of a larger switch statement you've ommited, and that you've declared x, y, x2, and y2 before the code segment you've shown me, since...
No, in Windows, interrupts are dead. I learned that the hard way.:mad:
Just make it a normal Windows application, create a bare-bones message-processing routine, and specify WS_POPUP during window...
Right, but I'm talking about
return array[index];
not
return dummy;
In an old C++ book I have, the following example is given for overloading the [] operator:
int &IntArray::operator[] (int index)
{
static int dummy=0;
if((index=0) && (index <...