Changing an IP Address

Can anyone tell me how to change an IP address on a NIC within a program
using ioctl? I know to use SIOCSIFADDR but am not quite sure how.

Thanks
Mark Komus
CDS Technologies