Suppose I need this be done
I have a function, such as:
int dbs_access(chat* name, char* sql, void* outbuf, unsigned int buflen, int* outresutl)
{ do some query here and output result}
I want to get some data from DBS, so I need get some buffer and call the function above, since I don't know how many records in tables, so I can't use array, I don't want want to use new or malloc to get some memory either, because releasing memory could be a problem here. Therefore I want to use vector. But I am not sure this would be guaranteed by c++ standard ,any view?
unsigned int count;
dbs_access(...,"select count(*) from..",&count,sizeof(count),...)
std::vector records[count];
assert(records.size()==count)
dbs_access(...,"select from..",&records[0],records.size(),...)