libNbiotCore/src/nbiotstring.cpp
// constructs an empty zero terminated string
constructs an empty zero terminated string
constructs an empty zero terminated string
string::string() :
        data(NULL),
        sz(0),
        mem_size(0)
{
    data = (char*)malloc(sizeof(char));
    if(NULL != data)
    {
        data[0] = 0;
        mem_size = sizeof(char);
#ifdef DEBUG_STRING
        stringMem++;
#endif
    }
}
string :: string ( ) : data ( NULL ) , sz ( 0 ) , mem_size ( 0 ) { data = ( char * ) malloc ( sizeof ( char ) ) ; if ( NULL != data ) { data [ 0 ] = 0 ; mem_size = sizeof ( char ) ; #ifdef DEBUG_STRING stringMem ++ ; #endif } }
constructs an empty zero terminated string
constructs an empty zero terminated string