Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C++ Blank Throw Statement

Name: Anonymous 2006-01-15 12:26

Hi. This may seem like a newbie question, but its not.
See, I have NO IDEA how to catch a BLANK throw stement.

(e.g.)

try{   throw;   }
catch(?)// No idea what to put to catch the blank throw statement above
{}

Let's see if anyone can figure this out, eh?
Chears!

Name: Anonymous 2006-01-15 12:42

throw;

Name: Anonymous 2006-01-15 12:51

jesus even fucking google can figure this out

Name: Anonymous 2006-01-15 13:31

>>2
>>3
It doesn't work man! I tried it!


    try
    {
        throw 1;
    }
    catch(int)
    {
        putch('\a');
        throw;
    }
    catch(...)
    {
        putch('\a');
    }
}

Anyone smart enough to solve this intriguing piece of code?
Chears!

Name: Anonymous 2006-01-15 14:11

>>4
What's so intriguing about it, and what part of it requires smarts? An exception thrown in one catch block will never be caught by another catch belonging to the same try.

Name: Anonymous 2006-01-15 14:38

>>5
Hahaha! U got me :p
Well, i didn't know that :p

In that case...
what do u mean by re-throw?
Can u provide an example to illustrate your point?

Chears!

Name: Anonymous 2006-01-15 14:54

try {
    try {
        try {
            throw 1;
        }
        catch(int e) {
            printf("lol, caught %d\n", e);
            throw;
        }
    }
    catch(int e) {
        printf("lol, caught %d again\n", e);
        throw;
    }
}
catch(...) {
    printf("lol, caught some shit\n");
}

Name: Anonymous 2006-01-15 15:06

>>7
Phew! UR THE MAN!!!
U win the Internet!

Chears!

Name: Anonymous 2010-11-15 16:34

Name: Anonymous 2010-12-25 8:30

Name: Anonymous 2011-02-03 4:31


Don't change these.
Name: Email:
Entire Thread Thread List