I have a class which takes an SQL query, executes it, then binds every column in the resultset as SQL\_C\_WCHAR using row-wise binding.

right now the way I do it is to allocate a vector of char, and determine the pointers to give SQLBindColumn as follows:

* buffer for column 1 = &vec[0]
* buffer for length indicator of column 1 = &vec[0] + (sizeof(SQLWCHAR) \* length of column 1)
* buffer for column 2 = &vec[0] + (sizeof(SQLWCHAR) \* length of
column 1) + sizeof(length indicator)
* buffer for length indicator of column 2 = &vec[0] + (sizeof(SQLWCHAR) \* length of column 1) + sizeof(length indicator) + (sizeof(SQLWCHAR) \* length of column 2)

and so on

this is causing some alignment issues (on SPARC). I know I need to add some padding, but I don't know how to calculate how much portably.