Hacker News new | ask | show | jobs
by slmjkdbtl 2103 days ago
The time [0] I found out about ptr_b in

  int* ptr_a, ptr_b;
isn't actually initialized as a pointer I changed all my C code to marking * before the variable name, fun times. It's helpful to think int as the base type and * the indicator of functionality like [] and ().

Also just found out the author was the developer of Adium [1], which is one of my favorite softwares (best logo) on macOS.

[0] http://c-faq.com/decl/charstarws.html

[1] https://adium.im/

2 comments

Besides writing

  "int *p"
 
instead of

  "int* p"
 
I also always use one line per variable declaration, which should avoid confusion when the first style is used. But that's my personal preference.

Edit: corrected code quotation.

When quoting code, leave a line and indent by two spaces.
Sorry, will do so in the future. Thx.
"int* p" really grinds my gears
I used to use that years ago! I had to stop when everyone moved over to Facebook Chat (what became Messenger) and eventually made a breaking change Adium couldn't support.