[问题] C 语言能像 Python 一样写段落文章吗?

楼主: henry8168 (番薯猴)   2018-10-12 13:23:05
Python 有个很神奇的功能,就是注解能被直接拿来输进变量。
例如
text="""Hello,
world."""
我现在想写一个 function 的 help,
想说有没有类似的作法能写进去,
而不需要一大堆的 \n 来排版?
谢谢。
作者: aiwhat   2018-10-12 13:42:00
#1Rko-g7E 推文有提到 raw string
作者: testPtt (测试)   2018-10-12 13:48:00
看工具 类似__attribute__ 的东西
作者: kdjf (我抓得到什么呢?)   2018-10-12 14:34:00
疴... python那个是multi line string不是注解只是fucntion def的第一个没被接收的string会被当help
作者: uranusjr (←這人是超級笨蛋)   2018-10-12 15:11:00
你搞错很多事情, 不过答案是没有, 需要额外的工具来解析
作者: aiwhat   2018-10-12 20:00:00
抱歉没注意到是C#define str(s) #s 这个呢?我好像搞错了…
作者: Bencrie   2018-10-12 21:37:00
不然就另外写成 .txt 然后包进 binary 当 resource?

Links booklink

Contact Us: admin [ a t ] ucptt.com