编译器错误:'使用'''之前'预期的不合格ID

ryw*_*ite 1 c++ compiler-errors

这是我的代码:

    //test file
    #include <iostream>
    #include "stat.h"
    #include "frequency.h"

    using namespace std;

    int main(){
      cout << "helo"<< endl;
      return 0;
    }
Run Code Online (Sandbox Code Playgroud)

当我尝试编译时,我得到:

    test.cc:7: error: expected unqualified-id before "using"
    test.cc:7: error: expected `,' or `;' before "using"
Run Code Online (Sandbox Code Playgroud)

知道这里发生了什么吗?

chi*_*uba 8

你可能错过了; 在头文件的末尾.

它应该如下所示:

 class frequency {
      ...
 };
Run Code Online (Sandbox Code Playgroud)