error: request for member '*' in '*', which is of non-class type '*'


代码:
if (-1 == munmap (buffers.start, buffers.length))

错误:
 error: request for member 'start' in 'buffers', which is of non-class type 'buffer*'
 error: request for member 'length' in 'buffers', which is of non-class type 'buffer*'

原因:

主要是buffers是指针, 但是引用其成员的时候使用了".", 把它当作一般的变量使用了, 这样就会导致这个编译错误.

当然产生这个编译错误的原因还有其他,

例如: 变量虽然定义了, 但是没有在使用的地方之前定义等等



修改后:
if (-1 == munmap (buffers
->start, buffers->length))

你可能感兴趣的:(buffer)