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

Sepples quiz

Name: Anonymous 2012-08-31 23:49

What does it output?

using namespace std;
#include <iostream>
int main() {
    try {
        void *(*fp)(const int * const);
        throw fp;
    }
    catch(void *(*e)(int *)) {
        cout << "A" << endl;
    }
    catch(void *(*e)(int * const)) {
        cout << "B" << endl;
    }
    catch(void *(*e)(const int *)) {
        cout << "C" << endl;
    }
    catch(void *(*e)(const int * const)) {
        cout << "D" << endl;
    }
    return 0;
}

Name: Anonymous 2012-09-01 4:49

>>9
I generally try to write it in a way so that it will:

* work the first time I write it,
* continue to work after writing lots of other things that affect it and are affected by it,
* be portable across the various compilers,
* be readable for myself and (most) others
* achieve the theoretical asymptotic bounds for memory use and time.
* achieve reasonable constants for memory and time in reference to the above,
* for each component to have a specific and proven necessary purpose

and I used to code like:

* hey lets see if I can make this hash by chaining algorithm all fit inside of a single for loop heading with an empty body.

>>10
I code in lisp in my head but then I compile it to C and C++ as I type.

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