2 ms·
> Considering this is C, there is no way to prevent this easily since you can't express a type that is one-way convertible (i.e. sds -> char* ok, char* -> sds n
by pantalaimon 7y ago
> Considering this is C, there is no way to prevent this easily since you can't express a type that is one-way convertible (i.e. sds -> char* ok, char* -> sds not ok).
typedef struct {
char *s;
} sds_t;
will produce an error if you try to pass a char* instead.
http://codepad.org/CmrskN9n http://codepad.org/CmrskN9n
- deleted 7y ago[deleted]