Hi Rob,


>> size_t size = load_file->Length(); >> >> char in[size]; >> unsigned long nLoadSize = load_file->Read((void *)in, size); >> unsigned char out[2 +(257*nLoadSize)/254]; >> sqlite_encode_binary((const unsigned char*)in, 257*nLoadSize)/254, >> (unsigned char*)out); > > > This is actually real basic C. > > Your problems are with allocating memory. > The following lines wont work as they are evaluated at compile time, not > at runtime. > >> char in[size]; >> unsigned char out[2 +(257*nLoadSize)/254]; > > > Instead you should use: > > unsigned char* in = malloc( size ); > unsigned char* out = malloc( 2 +(257*nLoadSize)/254 );

well, any decent C compiler should choke on this line:

>> char in[size];

>> unsigned char out[2 +(257*nLoadSize)/254];

assumed, it didn't, let me think he is using a C99 capable compiler
where this *does* work.

/eno


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to