Consider the following C code:
typedef char * MYCHAR;
MYCHAR x;
My understanding is that the result would be that x is a pointer of type \"
I prefer leaving the *
, it shows there's a pointer. And your second example should be shortened as char* x;
, it makes no sense.
If you look at several existing APIs, it looks as if not putting the pointerness into the type seems better style:
FILE *
MYSQL *
returned by MySQL's mysql_real_connect()MYSQL *
returned by MySQL's mysql_store_result() and mysql_use_result()and probably many others.