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

看板C_and_CPP (C/C++)作者 (神崎・H・アリア)時間2年前 (2022/04/05 12:00), 編輯推噓5(5011)
留言16則, 7人參與, 2年前最新討論串1/1
原文 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/ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.231.60.117 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1649131210.A.969.html

04/05 13:18, 2年前 , 1F
那int *a, b(void);的b是function declaration還是poin
04/05 13:18, 1F

04/05 13:18, 2年前 , 2F
ter?
04/05 13:18, 2F

04/05 13:19, 2年前 , 3F
打錯 我想說的是int* a, b(void);
04/05 13:19, 3F

04/05 13:46, 2年前 , 4F
樓上沒看內文齁 抓到 XD
04/05 13:46, 4F

04/05 18:08, 2年前 , 5F
如果b是function pointer那是回傳int還是int*啊
04/05 18:08, 5F

04/06 11:19, 2年前 , 6F
只好打int*a,b了
04/06 11:19, 6F

04/06 14:54, 2年前 , 7F

04/06 14:54, 2年前 , 8F
最好笑的肯定是這個,雖然不是愚人節
04/06 14:54, 8F

04/06 15:03, 2年前 , 9F
真的好笑XDD
04/06 15:03, 9F

04/07 03:08, 2年前 , 10F
純粹好奇 如果打int* a, *b; b是pointer還是pointer
04/07 03:08, 10F

04/07 03:08, 2年前 , 11F
to pointer XD
04/07 03:08, 11F

04/07 03:09, 2年前 , 12F
我習慣是寫int *a, *b; 保證沒問題
04/07 03:09, 12F

04/07 03:27, 2年前 , 13F
我已經分不清楚誰是在反串誰是真的在問問題了
04/07 03:27, 13F

04/07 13:31, 2年前 , 14F
ck那篇也太歡樂XDD 以後就叫arrow operator好了(X
04/07 13:31, 14F

04/10 01:58, 2年前 , 15F
這比較有料
04/10 01:58, 15F

04/10 01:58, 2年前 , 16F
04/10 01:58, 16F
文章代碼(AID): #1YIxxAbf (C_and_CPP)
文章代碼(AID): #1YIxxAbf (C_and_CPP)