Programming/C Win32 MFC2009. 6. 9. 22:20
K&R Style
int main(int argc, char *argv[])
{
    ...
    while (x == y) {
        something();
        somethingelse();
        if (some_error)
            do_correct();
        else
            continue_as_usual();
    }
    finalthing();
    ...
}

ANSI Style(Allman Style)
while(x == y)
{
    something();
    somethingelse();
}
finalthing();

BSD KNF Style
while (x == y) {
        something();
        somethingelse();
}
finalthing();

Whitesmiths style
void MyFunc ()
    {
    while (x == y)
        {
        something();
        somethingelse();
        }
 
    finalthing();
    }

GNU Style
static char *
concat (char *s1, char *s2)
{
    while (x == y)
      {
        something ();
        somethingelse ();
      }
    finalthing ();
}

Horstmann style
while (x == y) 
{   something();
    somethingelse();
    //...
    if (x < 0)
    {   printf("Negative");
        negative(x);
    } 
    else 
    {   printf("Positive");
        positive(x);
    }
}
finalthing();



[링크 : http://en.wikipedia.org/wiki/Indent_style]
Posted by 구차니