Static function declared but not defined in C++

后端 未结 7 1968
小鲜肉
小鲜肉 2020-12-23 18:50

I\'m getting an error from the following code using C++.

Main.cpp

#include \"file.h\"

int main()
{
   int k = GetInteger();
   retu         


        
相关标签:
7条回答
  • 2020-12-23 19:24

    functions declared as static arelocal to the containing file. Therefore, you have to define the function in the same file as the ones who call it. If you want to make it callable from other file, you must NOT declare it as static.

    0 讨论(0)
提交回复
热议问题