I couldn't find an specific answer to my problem. I have a char array which I converted to a string so I could find a substring.
If the substring match a requirement the original char array should change and it would be printed via cout.
Example:
Original char array: "msg: this is a message"
Requirement: start with "msg:"
If it matches return "I received msg: this is a message --received"
but when I print that I see the following:
"I received msg: this is a message^%$^% --received"
If there is a correct way to do this I would greatly appreciate some advice.
The original char array actually doesn't matter , but I need to return a char array like I explained before, this means some characters before and after the original array.
I'll try that suggestion tonight and give you an answer.
Thanks for the help