Search:

Type: Posts; User: DarkDragon

Search: Search took 0.01 seconds.

  1. Array of pointers + strcpy = access violation?

    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...
  2. Replies
    4
    Views
    1,238

    Thanks, but I'm still confused... But in the...

    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......
  3. Replies
    4
    Views
    1,238

    :rolleyes: 1. Regardless of what ANSI may think,...

    :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...
  4. Replies
    4
    Views
    1,238

    Strange result when comparing two doubles

    #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
  5. Replies
    4
    Views
    880

    Yes, programs (especially Windows ones) require a...

    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,...
  6. Replies
    4
    Views
    983

    You know, there's an edit button for when you...

    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&.
  7. Replies
    9
    Views
    1,276

    Why?

    Why?
  8. Replies
    35
    Views
    8,074

    Poll: According to my compiler and profiler, cout is on...

    According to my compiler and profiler, cout is on average 5.75 milliseconds faster than printf. So much for that argument...
  9. Replies
    4
    Views
    1,198

    B is inversely proportional to A. So B=C/A.

    B is inversely proportional to A. So
    B=C/A.
  10. Replies
    2
    Views
    1,160

    Transferring control to other execs

    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.
  11. Replies
    4
    Views
    1,472

    Sure. First, don't forget to #include...

    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...
  12. Replies
    4
    Views
    1,472

    Sorry, but I'm very confused... I'm assuming the...

    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...
  13. Replies
    25
    Views
    27,093

    No, in Windows, interrupts are dead. I learned...

    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...
  14. Replies
    3
    Views
    1,385

    Right, but I'm talking about return...

    Right, but I'm talking about

    return array[index];

    not

    return dummy;
  15. Replies
    3
    Views
    1,385

    Returning references (scope problems?)

    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 <...
Results 1 to 15 of 15