[闲聊] C syntax proposal int * a,b

楼主: KanzakiHAria (神崎・H・アリア)   2022-04-05 12:00:06
原文
https://twitter.com/typeswitch/status/1510994241631227907
int* a, b; // both a and b are pointers
int *a, b; // a is a pointer, but b isn't
int * a, b; // a is a pointer, whether b is a pointer is implementation-defined
这个还算好笑
历史愚人节笑话回顾
C++ deprecating raw pointer
https://www.cppstories.com/2018/04/deprecating-pointers/
作者: Dracarys (MayShowGunMore)   2022-04-05 13:18:00
那int *a, b(void);的b是function declaration还是pointer?打错 我想说的是int* a, b(void);
作者: CoNsTaR ((const *))   2022-04-05 13:46:00
楼上没看内文齁 抓到 XD
作者: Dracarys (MayShowGunMore)   2022-04-05 18:08:00
如果b是function pointer那是回传int还是int*啊
作者: testPtt (测试)   2022-04-06 11:19:00
只好打int*a,b了
作者: ck574b027 (荒围!定厝!贼!妹!)   2022-04-06 14:54:00
https://stackoverflow.com/questions/1642028最好笑的肯定是这个,虽然不是愚人节
作者: Lipraxde (Lipraxde)   2022-04-06 15:03:00
真的好笑XDD
作者: peter98 (新兵)   2022-04-07 03:08:00
纯粹好奇 如果打int* a, *b; b是pointer还是pointerto pointer XD我习惯是写int *a, *b; 保证没问题
作者: CoNsTaR ((const *))   2022-04-07 03:27:00
我已经分不清楚谁是在反串谁是真的在问问题了
作者: sarafciel (Cattuz)   2022-04-07 13:31:00
ck那篇也太欢乐XDD 以后就叫arrow operator好了(X
作者: Dracarys (MayShowGunMore)   2022-04-10 01:58:00
这比较有料https://bit.ly/3NZI4CJ

Links booklink

Contact Us: admin [ a t ] ucptt.com