I'm a new in programming. Recently, I began to learm the language C++. One of my good program to make is connecting PC's by telephone lines. Please, inform me about how to use the device modem by the C++. Write some examples, if possible.

What do you mean? Does your program operate over networks?

I think you need to study c++ until you have learned it well before attempting to do complex things like sockets, server/client, networks.

I mean that two pcs exchange information and nothing else. It is useful when playing a game with a friend situated in far distance.

The answer is still the same -- you need to know sockets and how to write clinent/server. Its not a very eash task, and what you describe might take you 1-2 years to complete.