how to assign more than one ip address in linux

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

--- 10.0.0.150 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
Source

Also in C++: