I am assuming your program crashes with an "Access violation writing location...".
This is caused because the
handle_text
function is called with a string that cannot be changed.
Calling the function like
handle_text( " Hello World " );
and
char* st = " Hello World ";
handle_text( st );
will cause the access violation. This is because these string literals are stored in read only memory and any attempt trying to alter them will result in the access violation.
However calling it like
char st[] = " Hello World ";
handle_text( st );
will work.