我有一個字符串對象的引用,我如何從中獲取數據。這裏是我的示例:獲取參考文獻的內容
string key = "key1";
gpointer somepointer;
GHashTable* myTable;
g_hash_table_insert(myTable,&key1,somepointer);
GList *keysList = g_hash_table_get_keys(myTable);// here i got keys previously set
keysList = g_list_first(keysList);
string recentKey = (keysList->data);
數據引用字符串的引用。我怎樣才能從參考
如果'data'是'串'(到有效位置)那麼你的語句'string recentKey =(keysList-> data);'是適當的。您是否嘗試過打印或檢查它? – iammilind 2011-05-31 04:57:45