Enum declaration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Enum declaration

1,128件の閲覧回数
Cram
Contributor III

Dear all,

I am struggling with enum declaration in header file and I want make it global in order to use in two different C files.

While if I declare it in main.c there is no problem:

pastedImage_2.png

If I want to move it to derivate.h, some issue arise and I do not know how to make it extern:

pastedImage_3.png

I would appreciate your help.

BR,

Marc

0 件の賞賛
返信
1 返信

1,077件の閲覧回数
kef2
Senior Contributor V

Try defining type in header file:

typedef enum MyEnumType{enumvalue1, enumvalue2};

declaration in header:

extern MyEnumType status;

define status variable in C file:

MyEnumType status;

0 件の賞賛
返信