Exception Numbers (4343904 (0x424860))

This is a discussion on Exception Numbers (4343904 (0x424860)) within the C++ Programming forums, part of the General Programming Boards category; I'm trying to run a program that outputs some number, but I keep running across one error. Once the program ...

  1. #1
    Unregistered
    Guest

    Exception Numbers (4343904 (0x424860))

    I'm trying to run a program that outputs some number, but I keep running across one error. Once the program finishes, it automatically shuts down. This is what shows:
    Loaded 'C:\WINDOWS\SYSTEM\KERNEL32.DLL', no matching symbolic information found.
    The thread 0xFFEDAB41 has exited with code 4343904 (0x424860).
    The program 'C:\My Documents\...SlotMachineM2.exe' has exited with code 4343904 (0x424860).
    My program is here. I'd appreciate any help.

    P.S. The comments are because my teacher requires them. This is my first time experimenting with multiple functions, arrays, and most of the stuff like that.

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    It's not really an error (not one that's preventing your program from running). The C++ standard states that main() should return an int. So if your main() looks like -

    int main()
    {

    //Your code
    return 0;
    }

    then you'll get 'The thread XXXX has exited with code 0 (0x0)', because you've returned 0 from main(). At the moment a random value is being used. These messages are just for debugging purposes and are not indications of errors in your program. Errors or warnings will be displayed in the Build window.

    If you want to prevent your program from shutting down immeadiately, you'll either have to run it from within a console or use some method to pause it before the end.

    A few of your functions return values without specifying a return type. This is another thing that your compiler is letting you get away with that's not standard. If a function is returning a value, it's return value should be specified in it's declaration and definition. So you'd want something like -

    short int NumUsers()
    {
    //your code here
    }
    Also, functions can only return one value at a time, unless these values are stored in some kind of data structure. So you can't do -

    return GainLoss, Remainder;

    However, as these are global variables you don't need to try and return them as they can be seen throughout your code.

    Lastly, if you are returning values from functions then you should use them. You call RandomCalcs() and Calculations() from main() and don't use the return values. If you're not using the return values and can see no need for them then declare your functions return type as void, and then you don't have to use the return statement (unless you want to leave the function early) -

    void RandomCalcs()
    {
    //your code
    }
    zen

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    In addition, this
    if (Tries[1] == Tries[2] == Tries[3])

    isn't what you think it is
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Unregistered
    Guest
    So how would I fix that problem? When I turned it in, I had to modify the random part a bit to make it run a little more realistically.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    > The thread 0xFFEDAB41 has exited with code 4343904 (0x424860).
    This is fixed by putting return 0; at the end of main, as zen showed you.

    > if (Tries[1] == Tries[2] == Tries[3])
    if ( (Tries[1] == Tries[2]) && (Tries[2] == Tries[3]) )

    Anything else, you'd need to post your code, your link is dead.

  6. #6
    Unregistered
    Guest
    Sorry about that. I don't need it anymore, though.

    Putting return 0 doesn't work; every program that I compile has that same problem, even the pre-programmed oens that come with my school's textbook. The thing is, it only happens when I compile it; no one else has the error. Do you have any ideas of what could be happening?

  7. #7
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    If you're running your program through the debugger then you'll always get that information, it's not an error. Try compiling it, by using the Build icon (F7) or Execute Program icon (ctrl - F5).

  8. #8
    Unregistered
    Guest
    Wow! Thanks, zen!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with outputting a list of squared numbers
    By dnguyen1022 in forum C++ Programming
    Replies: 28
    Last Post: 01-19-2009, 08:06 AM
  2. Matching numbers
    By kirksson in forum C Programming
    Replies: 7
    Last Post: 07-23-2008, 01:51 PM
  3. Question about random numbers
    By Kempelen in forum C Programming
    Replies: 2
    Last Post: 07-02-2008, 06:28 AM
  4. Program that prints numbers in columns
    By rayrayj52 in forum C++ Programming
    Replies: 12
    Last Post: 09-20-2004, 02:43 PM
  5. the definition of a mathematical "average" or "mean"
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 12-03-2002, 10:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21