2016-09-05 109 views
0

有人可以解释我在下面的代码中说明符的王是什么?并举例说明。复合格式说明符C

printf("\r\x1b[32mConverting: \x1b[36m%d\x1b[0m",(Convert));

+2

请说明您的具体问题或添加额外的细节,突显正是你需要的。正如目前所写,很难确切地说出你在问什么。请参阅“如何问问”页面以获取有关澄清此问题的帮助。 – Olaf

回答

1

字符串包含两个ANSI escape codes。在链接的文章中,例如CSI表示它们的含义\x1b[,例如, \x1b[32m对应于什么维基表示由CSI n m

CSI n m 
SGR – Select Graphic Rendition 
Sets SGR parameters, including text color. After CSI can be zero or more parameters separated with ;. With no parameters, CSI m is treated as CSI 0 m (reset/normal), which is typical of most of the ANSI escape sequences. 
+0

什么\ x1b和36m%d是? –