Re: [問題] 關於Class指標的觀念
讓我一個旁觀者來聊聊吧~
其實回到最初的問題
會討論這個也就是只想知道
「指標究竟能不能夠轉成 int 存起來使用?」
這邊 GCC 先生在一開始的推文提到
所有的指標都能夠轉成整數其實也只是為了回答這件事而已
不過後來發現
其實指標好像也不一定能轉成 int
就討論的結果來說, 各類型的 pointer 應該被看成是特殊的 struct
裡面有可能放著函數位址, 有可能放 type, 有可能放各式各樣莫名其妙的東西
你會說所有的 struct 都可以轉成 int 嗎?
我想這問題應該是否定的
至於到後來記憶體位置變成整數什麼的
我想 GCC 先生後來的整數定義應該是
「一個由 N 個 bit 組成的空間」
那麼的確所有的東西都可以轉成整數
也不能說有錯吧
但這個整數很顯然不是 int
我相信兩邊討論的東西不一樣的時候再下去也是雞同鴨講啊 XD
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 175.180.70.81
→
09/08 10:49, , 1F
09/08 10:49, 1F
→
09/08 10:50, , 2F
09/08 10:50, 2F
→
09/08 10:51, , 3F
09/08 10:51, 3F
→
09/08 10:53, , 4F
09/08 10:53, 4F
→
09/08 10:53, , 5F
09/08 10:53, 5F
→
09/08 10:54, , 6F
09/08 10:54, 6F
→
09/08 10:55, , 7F
09/08 10:55, 7F
→
09/08 10:55, , 8F
09/08 10:55, 8F
→
09/08 10:56, , 9F
09/08 10:56, 9F
→
09/08 10:58, , 10F
09/08 10:58, 10F
→
09/08 11:00, , 11F
09/08 11:00, 11F
→
09/08 11:01, , 12F
09/08 11:01, 12F
→
09/08 11:02, , 13F
09/08 11:02, 13F
→
09/08 11:02, , 14F
09/08 11:02, 14F
→
09/08 11:02, , 15F
09/08 11:02, 15F
→
09/08 11:03, , 16F
09/08 11:03, 16F
→
09/08 11:04, , 17F
09/08 11:04, 17F
→
09/08 11:08, , 18F
09/08 11:08, 18F
→
09/08 11:09, , 19F
09/08 11:09, 19F
→
09/08 11:09, , 20F
09/08 11:09, 20F
→
09/08 11:11, , 21F
09/08 11:11, 21F
→
09/08 11:13, , 22F
09/08 11:13, 22F
→
09/08 11:14, , 23F
09/08 11:14, 23F
→
09/08 11:15, , 24F
09/08 11:15, 24F
→
09/08 11:16, , 25F
09/08 11:16, 25F
→
09/08 11:16, , 26F
09/08 11:16, 26F
→
09/08 11:16, , 27F
09/08 11:16, 27F
→
09/08 11:16, , 28F
09/08 11:16, 28F
→
09/08 11:21, , 29F
09/08 11:21, 29F
→
09/08 13:00, , 30F
09/08 13:00, 30F
→
09/08 13:01, , 31F
09/08 13:01, 31F
→
09/08 13:51, , 32F
09/08 13:51, 32F
→
09/08 13:51, , 33F
09/08 13:51, 33F
→
09/08 13:53, , 34F
09/08 13:53, 34F
→
09/08 13:54, , 35F
09/08 13:54, 35F
→
09/08 13:54, , 36F
09/08 13:54, 36F
→
09/08 13:55, , 37F
09/08 13:55, 37F
→
09/08 13:56, , 38F
09/08 13:56, 38F
→
09/08 14:04, , 39F
09/08 14:04, 39F
→
09/08 14:11, , 40F
09/08 14:11, 40F
→
09/08 14:15, , 41F
09/08 14:15, 41F
推
09/08 14:15, , 42F
09/08 14:15, 42F
→
09/08 14:15, , 43F
09/08 14:15, 43F
→
09/08 14:16, , 44F
09/08 14:16, 44F
→
09/08 14:18, , 45F
09/08 14:18, 45F
→
09/08 14:18, , 46F
09/08 14:18, 46F
→
09/08 14:22, , 47F
09/08 14:22, 47F
→
09/08 14:25, , 48F
09/08 14:25, 48F
推
09/08 14:26, , 49F
09/08 14:26, 49F
→
09/08 14:27, , 50F
09/08 14:27, 50F
→
09/08 14:27, , 51F
09/08 14:27, 51F
→
09/08 14:32, , 52F
09/08 14:32, 52F
→
09/08 14:32, , 53F
09/08 14:32, 53F
→
09/08 14:35, , 54F
09/08 14:35, 54F
→
09/08 14:35, , 55F
09/08 14:35, 55F
→
09/08 14:36, , 56F
09/08 14:36, 56F
→
09/08 15:11, , 57F
09/08 15:11, 57F
→
09/08 15:12, , 58F
09/08 15:12, 58F
→
09/08 15:15, , 59F
09/08 15:15, 59F
→
09/08 23:59, , 60F
09/08 23:59, 60F
→
09/09 00:00, , 61F
09/09 00:00, 61F
推
09/09 00:02, , 62F
09/09 00:02, 62F
→
09/09 00:07, , 63F
09/09 00:07, 63F
→
09/09 00:07, , 64F
09/09 00:07, 64F
→
09/09 00:44, , 65F
09/09 00:44, 65F
→
09/09 00:46, , 66F
09/09 00:46, 66F
→
09/09 00:58, , 67F
09/09 00:58, 67F
→
09/09 00:59, , 68F
09/09 00:59, 68F
→
09/09 01:44, , 69F
09/09 01:44, 69F
→
09/09 01:46, , 70F
09/09 01:46, 70F
→
09/09 01:47, , 71F
09/09 01:47, 71F
→
09/09 17:08, , 72F
09/09 17:08, 72F
推
09/09 17:12, , 73F
09/09 17:12, 73F
→
09/09 17:12, , 74F
09/09 17:12, 74F
→
09/09 17:13, , 75F
09/09 17:13, 75F
→
09/09 17:36, , 76F
09/09 17:36, 76F
→
09/09 19:57, , 77F
09/09 19:57, 77F
→
09/09 19:58, , 78F
09/09 19:58, 78F
→
09/09 20:17, , 79F
09/09 20:17, 79F
→
09/09 20:18, , 80F
09/09 20:18, 80F
→
09/09 20:18, , 81F
09/09 20:18, 81F
→
09/09 20:19, , 82F
09/09 20:19, 82F
→
09/09 20:22, , 83F
09/09 20:22, 83F
→
09/09 20:23, , 84F
09/09 20:23, 84F
→
09/09 20:26, , 85F
09/09 20:26, 85F
→
09/09 20:32, , 86F
09/09 20:32, 86F
→
09/09 20:32, , 87F
09/09 20:32, 87F
→
09/09 20:33, , 88F
09/09 20:33, 88F
→
09/09 20:33, , 89F
09/09 20:33, 89F
→
09/09 20:33, , 90F
09/09 20:33, 90F
→
09/09 20:37, , 91F
09/09 20:37, 91F
→
09/10 12:04, , 92F
09/10 12:04, 92F
討論串 (同標題文章)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章