can u tell if my first code is doing the same as this one?
No, since only you know what's with the dots....
However, I can say that this:
Code:
int main() {
MYSQL *p_Connection;
Initiate_mysql(&p_Connection);
}
void Initiate_mysql(MYSQL** p_Connection) {
*p_Connection = mysql_init(NULL);
}
is functionally equivalent to:
Code:
typedef struct info_ {
MYSQL *p_Connection;
} info;
int main() {
info ConnInfo;
Initiate_mysql(&ConnInfo);
}
void Initiate_mysql(info *ConnInfo) {
ConnInfo->p_Connection = mysql_init(NULL);
}