char *c
better aligns with C/C++ philosophy, but char* c
is safer. The syntax char *c
says *c
(c
dereferenced) is a char
, which makes c
a pointer to char
. However, teaching/learning this syntax/philosophy can be hard when people are just getting introduced to pointers. Also, the declaration char *c, d
makes c
a char*
, but d
a char
. This confuses beginners who are used to declarations such as int a, b
which makes both a
and b
int
s. Thus, the declaration char* c
is preferred: easier to learn and safer.
N
nullusDefectus
@nullusDefectus
Posts
-
Why does most C/C++ developer prefers char *c instead of char* c?