multiple ip addresses

I am using a network card with 2 ip address ( i configured them using command “ifconfig alias” )
I am able to retrieve my primary ip addresse( original one ) from my program,but the alias ip address was unable to retrieve.

i am using ioctl(…) to retrieve the ip addresses
give some suggestions in this regard