HOW to change value of a number present in a string

string: this is a 79 pc
output that i want: this is a 200 pc
echo "this is a 79 pc" | sed s/79/200/

That, obviously, is not C++ but it gives the requested result.

With C++ string you would first try to locate the substring that you want to change:
and then (if found) replace it with new substring:
Topic archived. No new replies allowed.