Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert unsigned char array into uint8_t array?

I need convert unsigned char array into unit8_t array maybe someone has an idea how to do it?

I tried to look for information on the Internet, but unfortunately I did not succeed.

:)

like image 296
Mantas Pranckūnas Avatar asked Oct 19 '25 09:10

Mantas Pranckūnas


2 Answers

So, have you tried uint8_t* myuint8array = (uint8_t*)myuchararray; ?

like image 116
Mike Nakis Avatar answered Oct 22 '25 03:10

Mike Nakis


You have

unsigned char arr[size];

and you want

uint8_t arr[size];

uint8_t is simply defined as

typedef unsigned char uint8_t;

:-)

like image 40
Robert Avatar answered Oct 22 '25 01:10

Robert