Jun 2, 2010 at 7:38pm UTC
I have some trouble of using pointer of pointer in a class
it is from a open source project, drizzle.
The new class is like
class DrizzleLock
{
public:
DrizzleLock(Table **in_table):table(in_table)
{}
Table **getTabke(){ retrun table; }
void setTabke(Table **in_table){ table = in_table; }
private:
Table **table;
}
First, I am not sure if my get/set function is correct here.
Second, when I use the class in some other file,
Do I need to type case sql_lock->getTable()?? when I pass the Table** to
another function?
void mysql_unlock_tables(Session *session, DrizzleLock *sql_lock)
{
if (sql_lock->getTableCount())
unlock_external(session,sql_lock->getTable(),sql_lock->getTableCount());
free((unsigned char*) sql_lock);
return;
}
Thanks for help,
Benjamin
Jun 2, 2010 at 8:07pm UTC
ops, that is typo when I post it :), thx for checking.
Yeah, so the function,
static int unlock_external(Session *session, Table **table,uint32_t count), has Table **table,
Is that means I need to type cast like this?
unlock_external(session,(Table**)(sql_lock->getTable()),sql_lock->getTableCount());
Jun 3, 2010 at 8:21am UTC
No typecasting needed here.
What errors is the compiler giving you?