Note that there are some explanatory texts on larger screens.

plurals
  1. USAvi Berger
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. CONot directly your ?, but some points re this low level practice, if your use case calls for it. Suggestion: use LCM of sizeof(A) and sizeof(B) to position start of 2nd object type(B). Remember to disallow normal instantiate, delete, copy/move and arrays of type B. Use factory function returning specialized smart pointer with customized delete handling to create/manage objects.
      singulars
    2. CO@veer You are entirely correct. I was thinking in general and didn't look closely at this specific case. In some other related cases, things could be different. If the function actually returned a long on a big endian machine, if nothing else, the return values are likely to not be what you expected. Similarly, if the function was expecting a long (and a long was bigger than an int), it would be using some bits from something else as part of the value. Further, the function would be looking in the wrong place for any subsequent parameters.
      singulars
    3. COVisual Studio C++ 6.0 is not compliant with the first C++ standard (1998) and had compatibility problems with trying to use the C++ standard library. The only reason to use it today is maintenance on legacy software. Switch to a compiler that supports standard C++ and the posted answers will solve your problem of dynamically increasing string sizes.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload