Mercurial
view dowa/d_string.c @ 68:70ca1d99f3fd
Mimicing what tsoding did for his video. Kinda cool.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Thu, 25 Dec 2025 20:03:51 -0800 |
| parents | fff1b048dda6 |
| children | 75de5903355c |
line wrap: on
line source
#include "dowa.h" char *Dowa_Int32ToString(uint32 int32, char *buffer) { sprintf(buffer, "%d", int32); return buffer; } const char *Dowa_String_Slice(const char *from, size_t start, size_t end) { static char buffer[1024] = {0}; size_t buffer_pos = 0; for (int i = start; start < strlen(from) || start < end; i++) { buffer[buffer_pos++] = from[i]; } return buffer; }