string uInput;
cout << "Enter message" << endl;
getline(cin, uInput);
I'm adding 1 here because in c strings we have '\0' at the end
unsigned char dataS[uInput.size()+1];
strcpy(reinterpret_cast(dataS), uInput.c_str());
I think this example will help others more in the future.