开发者

How to escape sprintf() % marks so they wont be recognized as variables?

开发者 https://www.devze.com 2023-01-06 07:28 出处:网络
So is this even possible? If i开发者_StackOverflow中文版 some day wanted to sprintf(str, \"%doodle %d\", var); output \"%doodle 123\" and not \"123oodle\", how can i stop the first %d from being proce

So is this even possible? If i开发者_StackOverflow中文版 some day wanted to sprintf(str, "%doodle %d", var); output "%doodle 123" and not "123oodle", how can i stop the first %d from being processed?


%% escapes the %

0

精彩评论

暂无评论...
验证码 换一张
取 消