Nested functions are not allowed but why nested function prototypes are allowed? [C++]

后端 未结 6 1487
余生分开走
余生分开走 2020-12-30 12:57

I was reading the linked question which leads me to ask this question.

Consider the following code

int main()
{
    string SomeString();
}
         


        
6条回答
  •  梦谈多话
    2020-12-30 13:42

    Function prototypes are hints for the compiler. They indicate that the functions are implemented somewhere else, if not already discovered. Nothing more.

提交回复
热议问题