MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / reverse

Function reverse

LibLemon/src/lemon/itoa.cpp:3–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <stdint.h>
2
3void reverse(char *str, int length)
4{
5 int c;
6 char *begin, *end, temp;
7
8 begin = str;
9 end = str;
10
11 for (c = 0; c < length - 1; c++)
12 end++;
13
14 for (c = 0; c < length/2; c++)
15 {
16 temp = *end;
17 *end = *begin;
18 *begin = temp;
19
20 begin++;
21 end--;
22 }
23}
24
25char* itoa(long num, char* str, int base)
26{

Callers 1

itoaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected