[問題] printf type of value
看板C_and_CPP作者qas612820704 (Lego)時間11年前發表 (2014/07/28 07:10), 11年前編輯推噓1(1推 0噓 8→)留言9則, 2人參與討論串1/4 (看更多)
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
GCC
請問在c底下我要怎麼print出我變數的type
例如說
int a;
float b;
char c;
我希望能print出
typeof(a)=int;
typeof(b)=float;
typeof(c)=char;
可是typeof很像不能這樣用?
跪求解
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.120.19.2
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1406531436.A.4E9.html
→
07/28 15:13, , 1F
07/28 15:13, 1F
→
07/28 15:14, , 2F
07/28 15:14, 2F
推
07/28 15:38, , 3F
07/28 15:38, 3F
→
07/28 15:39, , 4F
07/28 15:39, 4F
→
07/28 15:40, , 5F
07/28 15:40, 5F
→
07/28 15:40, , 6F
07/28 15:40, 6F
→
07/28 15:40, , 7F
07/28 15:40, 7F
→
07/28 15:42, , 8F
07/28 15:42, 8F
→
07/28 15:43, , 9F
07/28 15:43, 9F
那這樣子我懂了 感謝大大們 我再去思考一下為什麼我的code需要用到他
而且能怎麼改他 謝謝!
※ 編輯: qas612820704 (140.120.19.2), 07/28/2014 15:46:46
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 4 篇):