Hi, I wrote an application using mysql C API.
If I exit my application without closing database, will it be closed automatically? void error(int code) { printf("error: %d\n", code); exit(0); } int main() { ... error(-255); ... } How to pass the mysql database connector to a function? is this correct? : void error(int code, MYSQL db) { mysql_close(&db); printf("error: %d\n", code); exit(0); } Because I am not sure this will be correct ... should not it using pointer? Thanks. __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php