Questions tagged [uint32-t]

uint32_t is 32-bit unsigned integer type. To get this type in your program include or . (corresponding C++ files if you want these types in a C++ code)

Use PRIu32 and SCNu32 to print and scanf this type.

73 questions
1
vote
1 answer

Assigning a string to a char value from a struct

I'm trying to assign a string to a char value from a struct typedef struct blah_param_s { struct blah_param_s* param_next; blah_param_type_t param_type; } blah_param_t; typedef struct blah_param_char_s { blah_param_t param_hdr; …
edlo
  • 11
  • 1
1
vote
3 answers

error : conflicting declaration for uint32_t

When I try to compile my program first I got this error: error: ‘uint32_t’ does not name a type Then I included #include Now it turned out this error: /include/stdint.h:52: error: conflicting declaration ‘typedef unsigned int…
clouddy
  • 891
  • 2
  • 8
  • 10
1
vote
2 answers

PC-Lint error assigning unsigned int value to uint32_t variable

I have the following line of code: uint32_t address = 0x40000000U; This gives the following 3 PC-Lint errors when using the au-misra2.lnt configuration file: "*** LINT: "D:\_SVN\LPC1788-32 Dev Kit\Bootloader--4\Loadware\source\led.c"(7, 35) Note…
Mark
  • 1,759
  • 4
  • 32
  • 44
1
vote
3 answers

Read bits from uint32_t

I want to use a function that returns a uint32_t which is supposed to contain 8 bits of information, in little-endian format. Could someone give me some C++ code on how to extract these bits from the uint32_t type into chars, booleans or into any…
venkman
  • 91
  • 2
  • 9
1
vote
2 answers

C type declaration intN_t

How does the header stdint.h define u32 to be 32 bits on every machine? Could somebody elaborate on the process that stdint.h does to make this happen? Where can I find my machine's (Windows 7) stdint.h file?
CodeKingPlusPlus
  • 15,383
  • 51
  • 135
  • 216
0
votes
2 answers

Using qsort to sort unsigned integers

The program that I am working on takes a file and parses it line by line then changes each line into a uint32_t and adds it into an array. From there I am supposed to sort the array with qsort(). I wrote my program how I thought it should be but…
Dan Bradbury
  • 2,071
  • 2
  • 21
  • 27
0
votes
1 answer

Converting uint32_t to network byte order

i'm doing stuff for my studies, so yeah, it's homework. First: I got a working Java Server Application, i also had this client application i'm writing in c now working in java. Simple as is, i fail at sending the uint32_t to my java server. So let's…
Daniel
  • 157
  • 2
  • 12
0
votes
1 answer

Arduino String.toInt() function wrongly converts to uint32_t

I have a webserver running on an ESP32-Wrover_E. A user's session id is stored in cookie format. This session ID is coming from esp_random() function which returns an uint32_t type integer. It is being set on log in. When a user goes to any page or…
Dr.Random
  • 430
  • 3
  • 16
0
votes
1 answer

C++ Map with key and value data type as uint32_t gives error

On using uint32_t data type for the key and value in a map. I am getting an error no known conversion for argument. Here is what I tried int main() { uint32_t a = 5; uint32_t b = 9; map Mapper; …
H Kumar
  • 37
  • 6
0
votes
2 answers

Converting uint32_t to binary in C

The main problem I'm having is to read out values in binary in C. Python and C# had some really quick/easy functions to do this, I found topic about how to do it in C++, I found topic about how to convert int to binary in C, but not how to convert…
loulou
  • 21
  • 4
0
votes
1 answer

What does buffer overrun error in uint32_t mean?

I'm trying to write ARGB color data into a uint32_t variable through a for loop. I get an error: invalid write to m_imagedata[i][1],wriable range is 0 to 0 if (!render){ uint32_t* m_imagedata = nullptr; } else{ m_imagedata = new…
0
votes
1 answer

How to cast char* to uint32_t in C?

I have an array of char* defined as char *data_ptr = "ABCDEFGHIJKLMNOPQRSTUVWX". Also, I have a write buffer declared as static uint32_t wr_buff[32]. I iteratively extract 4 bytes from the array and put them in a substring of char defined as char…
lll
  • 1
  • 6
0
votes
2 answers

print uint32_t to string in C but not it's literally value

I'm reading an image file and I want to show the format it was compressed in console. In example, I read this: format = 861165636 (0x33545844), as my CPU reads and writes in Little Endian I do format = __builtin_bswap32(format); so now format =…
0
votes
1 answer

Read and write pcd file without PCL (Point Cloud library)

I'm trying to write a program that reads and writes PCL files without PCD (Point Cloud library), I can read the positions of each point without a problem, but the RGB value is written in uint32_t and I do not know how to read this format and…
Guy Perry
  • 11
  • 1
0
votes
1 answer

How to initialize and then later assign values to a uint32_t array in C++

I'm using C++ in Arduino to create a patternArray of random uint32_t values (colors), and compare those colors against colors a user enters via button from a predefined colorArray. The problem is that I need to initialize a random seed before I…
mheavers
  • 29,530
  • 58
  • 194
  • 315