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

Function itoa

Kernel/src/string.cpp:29–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29char* itoa(unsigned long long num, char* str, int base)
30{
31 int i = 0;
32
33 if (num == 0)
34 {
35 str[i++] = '0';
36 str[i] = '\0';
37 return str;
38 }
39
40 while (num != 0)
41 {
42 int rem = num % base;
43 str[i++] = (rem > 9) ? (rem - 10) + 'a' : rem + '0';
44 num = num / base;
45 }
46
47 str[i] = '\0';
48
49 reverse(str, i);
50
51 return str;
52}
53
54extern "C"
55void* memset(void* src, int c, size_t count) {

Callers 9

WriteFunction · 0.70
ErrorFunction · 0.70
InfoFunction · 0.70
KernelAssertionFailedFunction · 0.70
isr_handlerFunction · 0.50
PageFaultHandlerFunction · 0.50
PartitionDeviceMethod · 0.50
DiskDeviceMethod · 0.50
NetworkAdapterMethod · 0.50

Calls 1

reverseFunction · 0.70

Tested by

no test coverage detected