如何逃避sprintf()%标记,以便它们不会被识别为变量? [英] How to escape sprintf() % marks so they wont be recognized as variables?

查看:124
本文介绍了如何逃避sprintf()%标记,以便它们不会被识别为变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是可能吗?如果我有一天想要 sprintf(str,%doodle%d,var); 输出%doodle 123而不是123oodle第一个%d被处理?

So is this even possible? If i 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?

推荐答案

%%转义了%

这篇关于如何逃避sprintf()%标记,以便它们不会被识别为变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆