How to print uint8_t bytes array?

Pablo Díaz Amores

I have the following code:

uint16_t BufferSize = BUFFER_SIZE;
uint8_t Buffer[BUFFER_SIZE];

Buffer size is 64 bytes and is filled as:

Buffer[0] = 'P';
Buffer[1] = 'I';
Buffer[2] = 'N';
Buffer[3] = 'G';
Buffer[4] = 0;
Buffer[5] = 1;
Buffer[6] = 2;
Buffer[7] = 3;
Buffer[8] = 4;
.
.
.
Buffer[63] = 59;

I am trying to print the content of the Buffer using:

for( i = 0; i < BufferSize; i++ )
{

    PRINTF(Buffer[i]);

}

Also tried:

for( i = 0; i < BufferSize; i++ )
{
    PRINTF((const char*) Buffer[i]);
}

But it is not working.

Sandy

You should refer to the syntax of printf. C treats small and capital letters differently so you should write something like this:

printf("%c", Buffer[i])

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to copy uint8_t array in char array in c

From Dev

How to copy uint8_t array in char array in c

From Dev

How to determine array length of uint8_t?

From Dev

How to convert byte[] in Android to uint8_T array in C?

From Dev

How can I declare an uint8_t array in Java

From Dev

Array doubles in size if a struct defines both its uint16_t words and uint8_t bytes

From Dev

printw() won't print a single character from a uint8_t array

From Dev

how to cast uint8_t array of 4 to uint32_t in c

From Dev

How to assign uint16_t value into uint8_t array?

From Dev

how do I print the contents of an array of bytes as bytes?

From Dev

Print out the value uint8_t *

From Dev

How to extract values of different sizes from an array of uint8_t?

From Dev

Slice up an uint8_t array

From Dev

Array of uint8_t arrays

From Dev

uint8_t array with dynamic variable

From Dev

NASM assembly, How to print the first 4 bytes of a string array

From Dev

How to read an array of bytes from a file using datainput stream, and print the array of bytes in java

From Dev

uint8_t array within another uint8_t array possible?

From Dev

Incompatible pointer type 'uint8_t *' send to 'uint8_t **' - How can it be fixed?

From Dev

Will a uint8_t array be terminated by null similar to a char array?

From Dev

Portable method to extract uint8_t bytes from uint32_t values in c

From Dev

How to to print the size of a filesystem in bytes?

From Dev

converting char* to array of uint8_t (c)

From Dev

Convert array of uint8_t to string in C++

From Dev

for array loop use int or uint8_t?

From Dev

Passing an array of uint8_t to Arduino using gcc and termios

From Dev

Allocating memory for a double array using uint8_t

From Dev

converting char* to array of uint8_t (c)

From Dev

c++ convert string to uint8_t array and back

Related Related

  1. 1

    How to copy uint8_t array in char array in c

  2. 2

    How to copy uint8_t array in char array in c

  3. 3

    How to determine array length of uint8_t?

  4. 4

    How to convert byte[] in Android to uint8_T array in C?

  5. 5

    How can I declare an uint8_t array in Java

  6. 6

    Array doubles in size if a struct defines both its uint16_t words and uint8_t bytes

  7. 7

    printw() won't print a single character from a uint8_t array

  8. 8

    how to cast uint8_t array of 4 to uint32_t in c

  9. 9

    How to assign uint16_t value into uint8_t array?

  10. 10

    how do I print the contents of an array of bytes as bytes?

  11. 11

    Print out the value uint8_t *

  12. 12

    How to extract values of different sizes from an array of uint8_t?

  13. 13

    Slice up an uint8_t array

  14. 14

    Array of uint8_t arrays

  15. 15

    uint8_t array with dynamic variable

  16. 16

    NASM assembly, How to print the first 4 bytes of a string array

  17. 17

    How to read an array of bytes from a file using datainput stream, and print the array of bytes in java

  18. 18

    uint8_t array within another uint8_t array possible?

  19. 19

    Incompatible pointer type 'uint8_t *' send to 'uint8_t **' - How can it be fixed?

  20. 20

    Will a uint8_t array be terminated by null similar to a char array?

  21. 21

    Portable method to extract uint8_t bytes from uint32_t values in c

  22. 22

    How to to print the size of a filesystem in bytes?

  23. 23

    converting char* to array of uint8_t (c)

  24. 24

    Convert array of uint8_t to string in C++

  25. 25

    for array loop use int or uint8_t?

  26. 26

    Passing an array of uint8_t to Arduino using gcc and termios

  27. 27

    Allocating memory for a double array using uint8_t

  28. 28

    converting char* to array of uint8_t (c)

  29. 29

    c++ convert string to uint8_t array and back

HotTag

Archive