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

How does this work? (corrected)

Name: Anonymous 2013-02-05 14:16


#include <stdio.h>

int main ()
{
    int c, d;

    d = EOF;

    while ((c = getchar()) != EOF){
        if (c == ' ')
            if (c != d)
                putchar(' ');
        else
            putchar(c);
        d = c;
    }
    return 0;
}

Name: Anonymous 2013-02-05 20:17

>>7,8
Dumb faggots. If you have a single statement, you don't have to use braces and nor should you. Braces are supposed to group statements together.

if (foo == 1)
    bar = 2;

is actually more readable than
if (foo == 1) {
   bar = 2;
}

or whatever retarded way you would write it.

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