[問題] 指標
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
devc
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
餵入的資料(Input):
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
#include <stdio.h>
int main(int argc, char *argv[]) {
char a;
printf("%d\n",sizeof(a));
char *b=&a;
printf("%d\n",sizeof(b));
int *c=&a;
printf("%d\n",sizeof(c));
return 0;
}
補充說明(Supplement):
剛學指標, 想看一下系統char佔幾byte,想看指針在int char各佔幾byte
請問這邊sizeof內寫abc對嗎?
我印出來是1 4 4 => 我windows是32-bit
so.........對?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.243.157.65
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1439553705.A.DCC.html
推
08/14 21:29, , 1F
08/14 21:29, 1F
→
08/14 21:55, , 2F
08/14 21:55, 2F
→
08/14 22:07, , 3F
08/14 22:07, 3F
→
08/14 22:08, , 4F
08/14 22:08, 4F
→
08/14 22:09, , 5F
08/14 22:09, 5F
※ 編輯: GooLoo (111.243.157.65), 08/14/2015 22:10:23
→
08/14 22:12, , 6F
08/14 22:12, 6F
→
08/14 22:13, , 7F
08/14 22:13, 7F
→
08/14 22:13, , 8F
08/14 22:13, 8F
→
08/14 22:14, , 9F
08/14 22:14, 9F
→
08/14 22:16, , 10F
08/14 22:16, 10F
→
08/17 14:58, , 11F
08/17 14:58, 11F
→
08/17 15:01, , 12F
08/17 15:01, 12F
討論串 (同標題文章)