// using library <cstrarg>
char* nstrcat(char* name, ...)
{
int count =0, result_c =0;
char* result_n = name ;
char* i;
while(*result_n)
++result_c;
va_list ap;
va_start(ap, name);
for( i = name; i != '\0'; i = va_arg(ap, char*)){
for( count = 0; i[count] != '\0'; i++){
result_n[result_c + count] = i[count];
}
result_c += count;
}
va_end(ap);
}
Reference:
http://stackoverflow.com/questions/14023024/strcat-for-formatted-strings
No comments:
Post a Comment