I have been using ODBC in C. They have a defined type:
typedef void * SQLPOINTER;
typedef unsigned int SQLUINTEGER;
I have a function alloc_buffer:
void db_alloc_buffer(SQLUINTEGER buffSize, SQLPOINTER *Ptr)
{
*Ptr = malloc(buffSize);
memset(*Ptr, ' ', buffSize);
}
Is is safe/correct to de reference Ptr? or can I do:
void db_alloc_buffer(SQLUINTEGER buffSize, SQLPOINTER *Ptr)
{
Ptr = malloc(buffSize);
memset(Ptr, ' ', buffSize);
}