I want to use a small server-client program, by using two separated machines. The thing is that none of them has ubuntu as the main OS. In fact, these OS are in a virtualbox.
So the question is, what are the real address to connect the machines?
(my program is almost literally based in this one Linux Howtos: C/C++ -> Sockets Tutorial).
This has nothing to do with C but with your configuration of VirtualBox.
A quick search found an article about networking in VirtualBox (if the two VirtualBoxes are on different physical machines you probably need to use port-forwarding).
I suggest to ask the experts for further questions.
Change your network settings of Guest OS from NAT (which is default) to Host-only (most probably this will work for you).
With NAT, you do not have access to other OS's.
Host-Only Networking with VirtualBox - Christopher Maier's Technical Blog