How to take photos at the same time for multiple cameras in pure C++(without blueprint or sth)?

You can use the same code. It works fine and as you mentioned saves lower file sizes.