【发布时间】:2016-02-25 18:08:45
【问题描述】:
我正在尝试将 unsigned char* 转换为一个 const char* 并且我知道存在 reinterpret_cast<const char*> 但我不能在 上使用它>android,总是打印垃圾。
您能建议我另一种方法吗?
【问题讨论】:
-
你确定
reinterpret_cast导致垃圾,而不是它已经是垃圾? -
你有什么样的数据以及如何“打印”。
const char*可能被 I/O 视为 C 样式字符串。 -
我会复制它,因为来源是
const。 -
你实际上想做什么?您能尝试创建一个Minimal, Complete, and Verifiable Example 并展示给我们看吗?还有read about the XY problem.
-
@JamesRoot 你是对的,唯一我不怀疑的事情,似乎我现在开始编码了。
标签: android c++ android-ndk char