MySQL Forums
Forum List  »  Connector/C++

defining a global connection
Posted by: Stev Fro
Date: September 19, 2011 12:50PM

I am trying to modify the connect.cpp code. I am wondering how to define the connection parameter con as a global variable. I understand defining global variables is a bad practice in many cases, but I think I am stuck in this instance.

I have some extra functions that won't allow the connection information to be passed to it. So the only other way I can think of to allow these functions access to the connection information is to define a global connection.

Any help would be great, thanks.

Options: ReplyQuote


Subject
Views
Written By
Posted
defining a global connection
1967
September 19, 2011 12:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.