How many styles of writing functions are there in C?

后端 未结 4 1996
-上瘾入骨i
-上瘾入骨i 2021-01-13 00:03

So far, I know two styles:

/* 1st style */
int foo(int a) {
return a;
}

/* 2nd style */
int foo(a)
int a;
{
return a;
}

(I saw someone wri

4条回答
  •  囚心锁ツ
    2021-01-13 00:15

    The 2nd one is K&R C style syntax, but it is obsolete now. Checkout @Basile Starynkevitch's answer.

提交回复
热议问题