But if you really want my advice, asking the user to input a bunch of things one element at a time using input() is nothing but incredibly tedious and confusing. It's an unnecessary invitation for frustration and error. Functions take arguments. Your function needs two arguments - a char vector and a 3x3 matrix. Take then from the function call instead of pestering the user to retype everything repeatedly.
... and if you don't want spaces in the message, just strip them instead of relying on the input to be perfect.
message = message(message~=' ');