问题描述
输入无符号字符串数组,然后通过函数转换输出字符串数组
input: unsigned char src[6] = {
0x12, 0x32,0x56,0x78,0x90,0xab}
output:char[12] = {
"1232567890ab"}
代码
需要包含头文件<iostream>
、<stdio.h>
。代码演示直接在main函数中转换和封装成函数调用转换两种方式。
#include <iostream>
#include <stdio.h>
using namespace std;
typedef unsigned char BYTE;
//方法一:封装成函数(方便重复使用)
char* ByteOutputByChar(BYTE byData[], int _