Replace the first and last character by ' * ' then second and second last character and so on until the string has characters remaining
i = 0 ; j = n - 2 ; while ( j - i > 1 ) { s [ i ] = s [ j ] = ' * ' ; cout << s << " STRNEWLINE " ; i ++ ; j -- ; } }