Strings in C may not be as flexible as you want at a glance.
What you did with "char outStr []" was to indicate that you need a char pointer that can be repeated using the array syntax ... it does not create a real store for characters, because you never mentioned how much you would like to save.
C , . , : , , , ; , .
, ,
#include <stdlib.h>
char *cpString;
"n"
cpString=malloc(n*sizeof(char));
strcat, printf, , n-1 charaters ( ).
,
memset(cpString,X,n-1);
cpString[n]=0;
XXXX... XXX\0, n-1 .
cpString, , ,
if (cpString !=0)
{
free(cpString);
cpString=0;
}
cpString=malloc(n*sizeof(char));
( "" ) n.
, free(), malloc() free().