Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Buggy Strcat
#include <iostream> #include <string.h> const char* strcat(const char* a, const char* b) { char buf[512]; size_t aLen = strlen(a); strcpy(buf, a); strcpy(buf+aLen, b); return buf; } int main() { const char* a = "hello, "; const char* b = "world"; std::cout << strcat(a, b) << std::endl; return 0; }
run
|
edit
|
history
|
help
0
Progress bar
Build char string (multibyte) with wchar
Additional layer of indirection
Struct packing
DCapSurfaceDesc
VS struct name enumerate
delete from list
dharmesh
Wide string conversion with multibyte chars and locale
codecvt wide string conversion with multibyte chars and locale + concatenation