line 32 and 33: That doesn't work because the string is located in read-only memory, and attempting to write to that memory will most likely fail. Correction: This puts the string in writeable memory. char BlankPattern[]="###############";
line 39: The above doesn't work either because you can not return a character array from a function. So your only choice is to allocate memory. Note that the calling function will have to call delete[] to properly destroy this string.
char* BlankPattern = new char[16];
// copy at most 15 characters to BlankPattern
// if [b]string[/b] is longer than that, then the remaining
// characters are ignored.
strncpy(BlankPattern, string, 15);
// now fill remaining positions with '#'
for(int n = strlen(string); i < 15; n++)
BlankPattern[n] = '#';
BlankPattern[15] = 0;
return BlankPattern;
}