Chinaunix

标题: 初始化问题 [打印本页]

作者: dongpy    时间: 2007-12-08 16:45
标题: 初始化问题
#include <pthread.h>
#include <stdio.h>

class A
{
public:       
A();
pthread_mutex_t  m;
};

A::A():m (PTHREAD_MUTEX_INITIALIZER)
{
}

int main()
{
        return 0;
}

编译出现错误:
testA.cpp: In constructor `A::A()':
testA.cpp:14: parse error before `{' token
testA.cpp:14: parse error before `{' token

请问这是什么原因?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2