"nmehring@gmail.com" <nmehring@gmail.com> wrote:
Thank you, I will correct that additional leak if i>0
The reason I am using these datatypes is because I am utilizing this
3rd party library method:
extern LONG SDEAPI SE_stream_update_row (SE_STREAM stream,
const ACHAR *table,
LONG *sde_row_id,
SHORT num_columns,
const ACHAR **columns);
So I figured I had to use the char data type.
Sorry, I thought you were using each column individually. i.e., I
thought the API was asking for char* and was being called multiple
times, not char** and called once.
However, I still recommend you use vectors rather than allocating the
memory yourself and hoping for the best.
Something like this would do nicely:
vector< vector< char > >
block( lColumnCount, SE_QUALIFIED_COLUMN_LEN );
for ( int i = 0; i < block.size(); ++i )
{
strcpy( &block[i].front(), CStringColumnName[i] );
}
vector< char* > columns( block.size() );
for ( int i = 0; i != block.size(); ++i )
{
columns[i] = &block[i].front();
}
SE_stream_update_row( /* other params */, &columns[0] );
memory but is safer (wrt. maintainance) and shorter and just more clear.
OP's boolean return.
string copy loop.
A: Because it messes up the order in which people normally read text.
A: Top-posting.