It is somewhat sad that there is no simple API for this. Fortunately, this is not too complicated, just verbose.
First get the system output device:
UInt32 size;
AudioDeviceID outputDevice;
OSStatus result = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOuputDevice, &size, &outputDevice);
Then set the volume:
Float32 theVolume;
result = AudioDeviceSetProperty(theDevice, NULL, 0, false, kAudioDevicePropertyVolumeScalar, sizeof(Float32), &theVolume);
Obviously, I skipped error checking, which is mandatory.
, 0 ( ). (, ), : 1 2.