Hi aruiz ,
Here's python example, and C++ is exactly the same (API is 1:1, so you can use chatgpt to convert it to c++):
import depthai as dai
p = dai.Pipeline()
left = p.create(dai.node.MonoCamera)
left.setBoardSocket(dai.CameraBoardSocket.CAM_B)
left.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
print('Left resolution', left.getResolution())
# Prints out "Left resolution SensorResolution.THE_400_P"