Compare commits

..

3 commits

Author SHA1 Message Date
Bruno BELANYI 00b1bd30f4 cpp: ex2: add solution 2022-11-21 17:12:19 +01:00
Bruno BELANYI e058a9be7d cpp: ex1: add solution 2022-11-21 17:11:03 +01:00
Bruno BELANYI a6c2f0aa26 c: ex3: add solution 2022-11-21 17:03:27 +01:00

View file

@ -26,7 +26,7 @@ void reverse_bytes(unsigned char* buf, size_t n) {
buf[i] = reverse_byte(buf[i]);
}
for (size_t i = 0; i < ((n + 1) / 2); ++i) {
for (size_t i = 0; i <= (n / 2); ++i) {
swap_bytes(&buf[i], &buf[n - 1 - i]);
}
}