How to replace a string in multiple files in linux command line

C++
cd /path/to/your/folder
sed -i 's/foo/bar/g' *

Source

Also in C++: