Skip to main content
Filter by
Sorted by
Tagged with
0 votes
3 answers
529 views

I'm currently working on a performance-oriented chess move generator and using lots of strongly-typed enum class declarations for things like Square, File, Rank, Color, PieceType, Castling, Direction ...
iab's user avatar
  • 3
0 votes
1 answer
46 views

I have a class Bar, with a reference of a class Foo which have a read method. I'm trying to unit test, using gtest, the behavior of the public method Bar::test(), which does something different based ...
LPo's user avatar
  • 95
3 votes
2 answers
165 views

In C language I have a uint8_t array and, after some logic, I need to cast to string and check if contains some substring like this: uint8_t data[8] = {0xcb,0xe2,0x3d,0x96,0x55,0xfc,0xcd,0x43}; //...
pacionet's user avatar
  • 361
1 vote
2 answers
324 views

I wanted to make sure that I understood what is happening in the following code: #include <stdio.h> #include <stdint.h> int main (void) { uint8_t a = 255; a = a + 5; printf(&...
Guilherme Cintra's user avatar
0 votes
1 answer
444 views

I have a big vector of bytes, and I want to take a part of it, interpret these bytes as ASCII characters written in hexadecimal system and print this substring on the screen. I don't need a copy, so I ...
razenkovv's user avatar
1 vote
1 answer
196 views

Concerning this question Convert from uint8_t * to char * in C The suggestion was simply to cast with (char*). Why is this acceptable in this context? Or did the responder just take the question ...
bilaljo's user avatar
  • 391
2 votes
1 answer
409 views

As a mobile developer working with React Native, I need to work with a C++ code that creates and encrypts files. I don't have much experience with C++ (the last time I wrote some was over 15 years ago ...
David Leuliette's user avatar
0 votes
1 answer
136 views

I am attempting to adapt an example from here which reads PDM microphone data and prints it to a computer using serial USB. I want to bypass the filtering stage in the example so I can write my own ...
jjjjbbb's user avatar
0 votes
1 answer
712 views

I am trying to write a fairly basic program in platformio using the esp-idf framework for an esp32. I have the main bits working, but i'm struggling with something that I thought would be very basic! ...
Andrew Taylor's user avatar
0 votes
4 answers
510 views

I am trying to write a program that can take a list of a specific type for example a double or float and convert it into bytes and write it to a file that can be converted back into that original list....
Sam Moldenha's user avatar
0 votes
1 answer
1k views

I had a vector of 3 elements all type uint8 that need to be converted to a uint32, I’m struggling to find the correct block to do that I tried unpacking the signals but then that creates a problem ...
Cody Sam's user avatar
-2 votes
2 answers
387 views

I'm trying to covert a 32 bit binary value into int8_t array. I'm not sure how to do this, and I'm struggling to find any documentation explaining the process. I was thinking that each 8 bits ...
user16030865's user avatar
0 votes
0 answers
426 views

I am trying to create a uint8_t array and try to change the first element of the array, then print it to the terminal as a string. But, after I assign currBlock (changed block) to arr[0], cout gives ...
sayonara's user avatar
0 votes
1 answer
161 views

I have a char *data that is a Datagram to represent the packet I want to send in but I need to insert on that an uint8_t array. // Datagram to represent the packet char datagram[4096], source_ip[32], *...
Ricardoke's user avatar
  • 153
0 votes
0 answers
44 views

knowing the value of the variable tempStatusSelectorByte is 0, in the if stament it is giving true for tempStatusSelectorByte>4. uint8_t tempStatusSelectorByte; tempStatusSelectorByte = ...
David Moreno García's user avatar
0 votes
2 answers
2k views

I have a typedef struct with different data types in it. The number array has negative and non-negative values. How do I convert this struct in to a unint8t array in C++ on the Linux platform. ...
jkafernando's user avatar
0 votes
0 answers
112 views

I am trying to send some data with BLE from an STM32 board to an Raspberry Pi 3B board. However, the "write" function of BLE API only supports uint8_t array transfer, but the data I need to ...
Adi_Hsiao_0410's user avatar
2 votes
1 answer
1k views

QString samp_buff[100]; QByteArray data; uint8_t speed; samp_buff[3] = data.toHex(); //I converted the QByteArray into a string qDebug() << "read_every_data_"<< samp_buff[3]; ...
TGanesh's user avatar
  • 33
-1 votes
1 answer
295 views

I have a decimal number and we have converted it to hex and have stored in a hex array. After that I added a "0x" to this number (in fact char array). Now I want to convert this hex number (...
sh.sagheb's user avatar
2 votes
1 answer
1k views

My C-API takes an array of uint8_t's as config parameter. I'm arriving at its doorsteps with a const char*. How do I now copy the chars over to the uint8_t array in the most unproblematic way? Here's ...
glades's user avatar
  • 5,392
0 votes
1 answer
1k views

I want to send a string over UART but the function that sends data over UART accepts uint8_t as an argument. The function prototype: UART2_Write(uint8_t txData); I wish to send an 8-character long ...
Rafay Shams's user avatar
1 vote
0 answers
119 views

I'm adding a clock to my program, but for some reason I cannot lower the value of my "sec" variable. I have a millisecond timer that raises a flag every ms. So, every 1000 ms I clear the ms ...
Wesley Kienhuis's user avatar
0 votes
1 answer
2k views

I'm writing a program in C++/C for raspberry pi pico. Pico has a 2MB of flash memory and it's SDK provides a function which allows to write data to that memory: void flash_range_program(uint32_t ...
Dominik's user avatar
  • 35
0 votes
1 answer
449 views

I made a utf8 to utf16 conversion where i get the code units for the utf16 char16_t. { std::string u8 = u8"ʑʒʓʔ"; // UTF-8 to UTF-16/char16_t std::u16string u16_conv = std::...
Ricardoke's user avatar
  • 153
0 votes
0 answers
171 views

data.columns Data dummy = pd.get_dummies(data['High_or_Low_Balance']) data2 =pd.concat((data, dummy), axis=1) data2 = data2.drop(['High_or_Low_Balance'], axis=1) data2.rename(columns={"True&...
And10's user avatar
  • 1
0 votes
0 answers
298 views

I'm doing CS50 (Week 4 Lab 4 Volume) and I have to copy a header from an input WAV file to output file (the 44 first bytes). To start, I created the array uint8_t header[HEADER_SIZE];. Then, I used ...
Maria's user avatar
  • 43
0 votes
1 answer
693 views

This question is about converting a gzip deflate message from a websocket message and convert it to array OR raw text that I can apply JSON.parse on it... *** to be also clear: In this question : i ...
John R's user avatar
  • 377
0 votes
0 answers
409 views

I'm using ctypes to use a C library in my python script. I have a function in C library that accepts as argtypes uint8_t and was wondering how to invoke it from python. This is the C function I'm ...
mtolkien's user avatar
1 vote
2 answers
627 views

I try to convert a part of an julia df from Int64 to Int8. input: array = convert(Array{Int8} , array ); output: InexactError: trunc(Int8, -9223372036854775808) Stacktrace: [1] throw_inexacterror(...
Benedikt Schwab's user avatar
0 votes
1 answer
2k views

How can I convert a uint8_t array to a char array or string in C? uint8_t array[10];
Eric's user avatar
  • 33
0 votes
1 answer
686 views

Why is data serialized using JSONSerialization differ from the data serialized with the extension below? let uint8Array: [UInt8] = [123, 234, 255] let data1 = uint8Array.data // 3bytes let data2 = try!...
Bigair's user avatar
  • 1,572
0 votes
1 answer
562 views

I am working on lab 4 of CS50 course which requires to read the header of an input file which is always 44 bytes and write it as the header of the output file. Below is the correct solution. const ...
lumpy_space_princess's user avatar
2 votes
1 answer
418 views

To implement a basic interface for an LCD I need to write the function print for all basic types. I need to write void print(char c); and also void print(uint8_t c); The first function tells: "...
Antonio's user avatar
  • 651
2 votes
1 answer
1k views

I am trying to decode some animated webp files in dart but getting the runtime error of 'index out of range and it should be less than N. and N is the size of file in bytes. But images other than this ...
CrackerKSR's user avatar
  • 2,028
7 votes
1 answer
220 views

I'm coding in C and I know the values that can be stored in a uint8_t range from 0 to 255. I want to store a value that is the percentage of MAX_INTENSITY, declared as: #define MAX_INTENSITY 200 Can I ...
ephtelule's user avatar
0 votes
0 answers
113 views

// userspace uint8_t value = 5; write (fd, (const char *)&value, 1); // kernel driver static ssize_t sysfs_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) {...
ruke's user avatar
  • 55
0 votes
1 answer
879 views

I am trying to transmit audio using CAN FD and the data format it sends it is in uint8_t, when the sample I take from the microphone with the ADC is an uint32_t. Will I have any problem trying to ...
Suspe18's user avatar
  • 15
1 vote
0 answers
798 views

std::stringstream sstream; uint8_t data[1] = { }; int x =1; sstream << "0x" << std::hex << x; //sstream = 0x04b35cc8 "0x1" why the sstream not be only ...
user216905's user avatar
0 votes
0 answers
16 views

In this case, i use an algorithm hashing to implementating blockchain, and then my algorithm is working properly but the output need to return string. This is my function to try only print the output ...
Angga Danar Prasetyo's user avatar
0 votes
1 answer
2k views

I have a web app (javascript) that needs to send a arduino(ESP32) a 12bit value (0x7DF). I have a websocket connection that only accepts a Uint8_t payload, so I split the value into 4 bytes (Uint8_t). ...
hamza765's user avatar
  • 126
0 votes
0 answers
439 views

How can I change a uint8_t array into an array of integers? For example if I want to print the numbers in the uint8_t array array_beam_sx I have to write: cout<<+array_beam_sx[0]; to see the ...
Vale's user avatar
  • 21
0 votes
1 answer
93 views

I've the following issue: from a socket, I receive an hexadecimal string, then I convert it to a byte array and save it into a uint8_t array. Here is the conversion function (it works): static size_t ...
Ferrari Service's user avatar
0 votes
1 answer
361 views

I've just found this interesting issue in one of my older projects. I'd defined a class wrapped around an std::shared_ptr to implement a simple dynamic array as you can see below: #include <memory&...
Robert Ikanov's user avatar
-2 votes
3 answers
212 views

I want to copy an uint8_t array to a uint8_t pointer uint8_t temp_uint8_array[] = {0x15, 0x25, 0x32, 0x00, 0x52, 0xFD}; uint8_t* Buffer = temp_uint8_array; And now : Buffer = {0x15, 0x25, 0x32}; So ...
Clément's user avatar
-2 votes
1 answer
1k views

My Arduino program receives a char* text message like this: char* messageFromWebSocket = "4692\n4408\n656\n358\n662\n356\n658\n376\n656\n358\n662\n1394\n660\n1392\n636\n378\n632\n382\n638\n1418&...
misza's user avatar
  • 13
1 vote
3 answers
842 views

I have, in a .txt file, a uint8_t array already formatted, like this: 0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00,...
DreamY's user avatar
  • 13
2 votes
3 answers
560 views

I was creating empty 2D vector in a header file by just providing size but unable to create it. class Grid { public: int rows = 5/0.05; int cols = 6/0.05; ...
QuickSilver's user avatar
1 vote
0 answers
36 views

Even setting the size of an enum is not enough to be able to assign it to a variable of the same size (http://coliru.stacked-crooked.com/a/edd287393f172abd): #include <iostream> #include <...
vegalock's user avatar
0 votes
0 answers
209 views

Trying to print the array elements, like below: typedef struct Info { UINT32 freq[8]; } Info; char FREQ[100]; sprintf(FREQ, "%u %u%c", Info->freq[0], Info->...
GNK's user avatar
  • 1,088
0 votes
1 answer
979 views

I've a function that can convert an hexadecimal string (ex. "02AFA1253...ecc.") into an uint8_t array. I would need to do the opposite, which is to convert the uint8_t array to a string of ...
user avatar

1
2 3 4 5 6