Thanx marsd, the code works now. (posted below)
But here comes another problem, the outAttrs doesn't return to caller.
In the caller method:
char** outAttrs; // have to defined like this
DBE_GEtRecord(2, "aaa", outAttrs);
for (i = 0; i < dbID[id].attrCount; i++)
printf("%s ",abc[i]); //...
The program is about writing an API on top of NDBM.
Here is the method that I'm talking about.
dbID is an array stores a structure that has info. about a table.
char* key is the key value of the table.
char** outAttrs is where I should store the list of attributes correspond to the key.
since...
I have no idea why this happen to me, plz help.
In a method i have:
char p[255] = "";
char* p2;
char** temp;
for (i = 0 ...){
...
p = "abc" // when i = 0
= "222" // when i = 1
p2 = (char*)p;
p2 = &p2[loc];
temp[i]=p2;
}
however, when I try to print out temp it gives...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.