Re: [問題] 列印變數
※ 引述《comferret (皓呆)》之銘言:
: 現在想要可以列印出變數名稱出來
: 例如
: int ABC=3;
: 我要列印出ABC出來,以前好像有寫過,
: 但是忘記= =問問看誰會,可以教導一下
: 用vc來寫。
: 感謝
試看看這樣行不行:
#include <stdio.h>
#define Paste(var) #var
int main(void)
{
int ABC = 3;
printf(Paste(ABC) "\n");
return 0;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.175.144.58
討論串 (同標題文章)