#include #include char* pstring; char* pstring2; char* hello = "11"; char* helloworld = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000"; void ncat(char* s1, char* s2) { if(strlen(s1) < strlen(s2)) s1 = realloc(s1,strlen(s1)+strlen(s2)+128); strcat(s1,s2); } int main(int argc, char *argv[]) { // ninit ? // nset pstring = (char*) malloc(strlen(hello)+5); strcpy(pstring,hello); pstring2 = (char*) malloc(strlen(helloworld)+5); strcpy(pstring2,helloworld); // ncat (not smart) if(strlen(pstring) < strlen(pstring2)) pstring = realloc(pstring,strlen(pstring)+strlen(pstring2)+5); strcat(pstring,pstring2); //ncat(pstring,pstring2); <-- vadi shits // show string printf(pstring); // nfree free(pstring); *pstring = '\0'; pstring = 0; free(pstring2); *pstring2 = '\0'; pstring2 = 0; printf("\n"); return 0; }