用枚举返回类型

问题描述 投票:0回答:1

GCC打印一个错误:

 error: 'enum c_style_enum ' is not a class or namespace
  142 |     friend c_style_enum ::c_func();
error: ISO C++ forbids declaration of 'c_func' with no type [-fpermissive]

返回类型C_FUNC()是INT或其他枚举以外的其他类型的WOKRS

如何做这项工作?

声明不应包括

friend
c++ c gcc
1个回答
0
投票
C_enum.h

enum
my_class.hpp

#pragma once typedef enum { val1 = 0 } c_style_enum_t; c_style_enum_t c_func();

示例示波器分辨率运算符。这里不需要操作员
希望,这应该解决您的汇编错误。
    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.