简体   繁体   English

typedef Char *未命名类型

[英]typedef Char* does not name a type

I'm facing some kind of problem as a beginner in C++. 作为C ++的初学者,我面临某种问题。 I want to specify my own types with pointers. 我想用指针指定自己的类型。 But my code doesn't compile. 但是我的代码无法编译。 Here's a glimpse of what i'm trying to do : 这是我要做什么的一瞥:

namespace mynamespace
{
    typedef os_uchar Boolean;
    typedef Boolean& Boolean_out;
    typedef Boolean* Boolean_ptr;

    [...]
}

And i'm getting errors for these lignes : 而且我得到这些木质的错误:

'os_uchar' does not name a type
'Boolean' does not name a type
'Boolean' does not name a type

How can I specify Boolean* and Boolean& as defined types ? 如何指定Boolean *和Boolean&作为定义的类型? Is it possible ? 可能吗 ?

I'd be grateful for your answers :) 感谢您的回答:)

All your errors come from the first one - 'os_uchar' does not name a type . 您的所有错误均来自第一个错误'os_uchar' does not name a type Simply include the header where the type os_uchar is defined and it should work. 只需在标头中包含定义os_uchar类型的标头os_uchar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM