Originally Posted by
KMAN999
I want to create a loop that adds the first value "this" by the command
Code:
strcat(l->value,l->db.param_value.val);
now i want to append a null and move it one more space to the right so i can have
if i do strcat continuously in a loop it just gives me "thisis", anyone have a suggestion on how to do this ?
Assuming you actually want a space char, then you may want to do something like this:
Code:
#include <stdio.h>
#include <string.h>
int main (void) {
char result[30]={0};
char *string1 = "This";
char *string2 = "is a line";
strcat(result, string1);
printf("%s\n", result);
strcat(result, " ");
strcat(result, string2);
printf("%s\n", result);
getchar();
return 0;
}