Prokee Module: mstr

From prokee
Revision as of 13:04, 12 June 2019 by Andy (talk | contribs)
Jump to navigation Jump to search

The module mstr provides basic functionality for strings (like copying, concatenation and comparison) with automated reallocation of larger memory blocks, if required.

Example

mstrs<char> *a;
mstr::create(&a,10);              // initial memory allocation of 10 Bytes
mstr::copy_str(a,"Hello World!"); // copying of a string (allocates a larger memory block for 'a')
printf("%s\n",mstr::c_str(a));
mstr::destroy(a);                 // frees all memory allocated for 'a'

Implementations