'indent style'에 해당되는 글 1건

  1. 2009.06.09 indent style
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 구차니

댓글을 달아 주세요