How to Programmatically Obtain the Current System Firmware Version in macOS Using C++ Without Using System Profiler

The current system firmware version is reported by System Profiler as “SPHardwareDataType”.

System firmware versions are also reported (as “Boot ROM”) in diagnostic logs, but here they are the system firmware versions at the time the logs were generated – not necessarily the current system firmware version.

Is there a way to programmatically obtain the current system firmware version in macOS using C++ without using System Profiler?

How to Programmatically Obtain the Current System Firmware Version in macOS Using C++ Without Using System Profiler
 
 
Q