I tried following things b开发者_Go百科ut I am getting the error
typedef '\0' DEFAULT_VALUE;
Error: expected unqalified id before '\0'`
typedef NULL DEFAULT_VALUE;
Error: expected unqalified id before __null
what I am doing wrong here?
The general syntax of a typedef
is:
typedef existing_type new_type_name ;
Since '\0'
and NULL
are not existing types you get the error.
Since you want define constants you can use the const
as:
const int DEFAULT_VALUE = '\0';
The keyword typedef
defines synonym for existing type. Neither \0
nor NULL
are type. May be you want something as follows:
#define DEFAULT_VALUE NULL
精彩评论