Menu

function "string_ptr_ptr()" problem

sakarab
2007-09-23
2013-04-23
  • sakarab

    sakarab - 2007-09-23

    The code is not like your example. It is rather like this:

    void *str_ptr = new ds_string();
    void *str_ptr_ptr = &str_ptr;
    ds_string **data = reinterpret_cast<ds_string **>(str_ptr_ptr);

    See the construct, copy_construct and destroy member functions.

     
    • ninyjun

      ninyjun - 2007-09-26

      THANKS!
      I think,when field's FieldDataType  is defined ftString (fixed length),you put ds_string* into cRawBuffer ? 
      you know ,the fixed ftstring can be taked for  char[n], maybe you can put actual data into
      cRawBuffer.

       
      • sakarab

        sakarab - 2007-09-29

        When the database field type is "string" (fixed length or not), the field data type in the dataset is "ftString" and the cRawBuffer contains a "ds_string *".
        For a fixed length string having a char array in the buffer is a solution but it makes the code a bit more complicated (you have to cater for fixed and variable strings and track the used space in the char[]) and you must allocate space which is not always used.

         

Log in to post a comment.