how to assign more than one ip address in linux

PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.097 ms
64 bytes from icmp_seq=2 ttl=64 time=0.100 ms
64 bytes from icmp_seq=3 ttl=64 time=0.105 ms

--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.097/0.100/0.105/0.012 ms

Also in C++: