Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Concatenate Strings
//clang 3.8.0 #include <stdlib.h> #include <alloca.h> #include <string.h> #include <stdio.h> /** concatenate strings without limit */ #define ZIP(s) ({ \ char* out = alloca(sizeof s); out[0]='\0'; \ size_t len = sizeof s/sizeof s[0]; \ for(size_t i = 0; i < len; i++) \ strcat(strrchr(out,'\0'), s[i]); out; \ }) int main( int argc, char** argv, char** env) { char *s[] = {"dog", "cat" + 1, strchr("horse", 'o') }; fprintf(stdout, "%s\n" , ZIP(s)); return 0; }
run
|
edit
|
history
|
help
0
Часы (graphics.h)...
UDP - Male/Velke pismena
13 12 2014 20:25
Numero pi
Use of Arithmetic Operator
Cvičenie -č.5-UDP
Cvičenie -č.6-UDP
Numero pi Euler
cv3
Triples bucles anidados