The Cisco manual describes this in detail.
Rather than try to restate the manual herein, which is way beyond the ability of this forum, I suggest you consult the manual.
Remember the switch does not have a DHCP server so you must manually set your pc on the subnet the switch is on and then change the IP address.
Often this is done easiest in CLI so if you do not know command line language, you will need to beef up your skill here as well. Again check the manuals.
The op wanted to read values from the rs232 in their c code and use them for processing. This has nothing to do with Cisco, DHCP nore IP addresses.