C++ doesn't have any built-in concept of a "MAC address", it's not something that has to exist in order for C++ code to run. Thus, it's platform-specific. You must tell us which platform you're trying to do this for, and also (of course) read documentation that matches that platform.
If you want to do this in a portable way, you should look for a suitable library that supports all the desired platforms.
Also, note that a computer can have any number of network adapters, so there's no requirement that there is just one MAC address.