After we have had our fun with the ICQ connection, we want to terminate the connection. To do this we need to logout from the network and disconnect from the server. The first is done using icq_Logout (line 221) and the second is done using icq_Disconnect (line 230).
We simply do:
icq_Logout(&link);
icq_Disconnect(&link);
And we're out.
We still need to clean our ICQLINK in order to free allocated resources.