This is a question that's entirely dependent upon your system.

Hundreds of thousands of computers don't even have a modem. Your program won't even think about working on those. Systems that have a modem may have them hooked up as ports on the I/O bus. Others may have them hooked up to memory-mapped ports.

Some of those systems won't have an OS (at least, not one worthy of the designation). That means you have to write what might be called an OS function. Those that have a relatively powerful OS might provide you with an existing API for such things. They might also require that you have the knowledge to access kernel-level code, which implies modes (real, or lower-level protected modes) that grant you access to facilities not granted for run-of-the-mill applications.

You need to be very specific with the information you supply. These things are not part of the C++ language, simply because the language cannot infer what the hardware specifics of your system might be. In instances that can't be covered by a standardized approach, you must provide gobs of information. Breeze through the "Before you post a query" thread for some limited indications of the importance of information.