Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In the dashed case, k is going to be zero or one (a<b is true or false). This works, though:

        int a=0, b=4;

        while(a < - - - - --b) {
                printf("b: %d\n", b);
        }


I just spent an hour constructing a class called Morse such that this outputs "HELLO WORLD!":

    Morse m;
    cout << (++++m) << (+m) << (+-++m) << (+-++m) << (---m) << ", "
         << (+--m) << (---m) << (+-+m) << (+-++m) << (-++m) << "!\n";
Damn you, C++! Why won't you let me overload the . operator? ;-)




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: