错误C2146:语法错误:缺少';'在标识符'data1'之前

时间:2016-03-03 07:26:22

标签: c++ c

我无法理解编译器在下面的情况下给出错误的原因。请帮忙。

test.h:C ++项目的一部分

using namespace std;
extern "C"
{
    #include "testc.h" 
}

class test
{
    private:
    public:
    work    data1; /*<-- Getting error here*/
    work    data2; */<-- Getting error here*/

    test();
};

testc.h:C项目的一部分

typedef struct
{
    int x;
}work;

0 个答案:

没有答案