typedef errors

 

Hello,

I'm trying something new to me and redefining some types to userdefined names, such as:

typedef uint          uint32_t;
typedef uchar         uint8_t;
typedef string        STRTYPE;
typedef const char *  STRCTYPE;
typedef int32_t       HRESULT;
typedef char          TCHAR;

But on compilation I'm getting the following errors:

'uint32_t' - unexpected token
'uint8_t' - unexpected token
'STRTYPE' - unexpected token
'*' - pointer cannot be used
'STRCTYPE' - unexpected token
'int32_t' - declaration without type
'int32_t' - unexpected token
'TCHAR' - unexpected token

Would someone tell me what I'm doing wrong please?

Thanks.

 
imamushroom:

Hello,

I'm trying something new to me and redefining some types to userdefined names, such as:


But on compilation I'm getting the following errors:

Would someone tell me what I'm doing wrong please?

Thanks.

MQL5 allows creating pointers to functions using typedef, not to be confused with the use of typedef in c++ for aliasing existing data type
 
Sardion Maranatha #:
MQL5 allows creating pointers to functions using typedef, not to be confused with the use of typedef in c++ for aliasing existing data type

Ok, thanks.

 
Use #define