[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: const char* typedefs
- From: Tim Hill <drtimhill@...>
- Date: Mon, 5 Feb 2018 21:00:58 -0800
> On Feb 5, 2018, at 8:00 PM, nobody <email@example.com> wrote:
> On 2018-02-05 23:50, Paige DePol wrote:
>> They also like putting the * for pointers on the variable name, which
>> is what Lua does as well. My previous experience with Obj-C usually
>> put the * with the type, which makes more sense to me, but I am now
>> used to putting it with the var name so either way works.
> That's because in C
> Foo* bar, baz;
> probably isn't what you want, and with
> Foo *bar, baz;
> it's easier to notice.
> -- nobody
>  bar is a pointer, baz isn't.
Which is an argument in favor of the typedef, since:
typedef const char *l_str;
l_str bar, baz;
DOES work correctly.