How do I exit the code at a certain breaking point in a function

You can use std::exit() after the cout statement