F4MP/f4mp_originalcode/thirdparty/zpl/code/apps/examples/strdup.cc
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

16 lines
329 B
C++

#define ZPL_IMPLEMENTATION
#define ZPL_NANO
#include <zpl.h>
int main()
{
char const* foo = "hello world";
//NOTE: length of a string + 1 extra byte for null terminator.
isize len = strlen(foo) + 1;
char *bar = zpl_strdup(zpl_heap(), (char *)foo, len);
zpl_printf("%s == %s\n", foo, bar);
return 0;
}