Linux 内核 - 整数到 ASCII

发布于 2024-08-27 06:09:30 字数 78 浏览 4 评论 0原文

我需要在 Linux 内核中将整数转换为 ASCII 表示形式。我该怎么做?我找不到任何内置的转换方法。内核中是否已有这些或我需要添加自己的?

I need to convert an integer to it's ASCII representation from within the Linux Kernel. How can I do this? I can't find any built-in conversion methods. Are there any already in the kernel or do I need to add my own?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清秋悲枫 2024-09-03 06:09:30

内核确实提供了snprintf(),这能满足您的需要吗?我也很好奇你在内核中用 ASCII 表示的整数做什么。

非常很可能只需要printk()

The kernel does offer snprintf(), would that suit your need? I'm also curious what you are doing with the ASCII representation of an integer within the kernel.

It's very likely that you just want printk().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文