diff --git a/src/Examples/StringExampleGetAllocatedSize.cpp b/src/Examples/StringExampleGetAllocatedSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..993ad3df4644e8d6330d7677a7064cc17f6ae729 --- /dev/null +++ b/src/Examples/StringExampleGetAllocatedSize.cpp @@ -0,0 +1,10 @@ +#include <iostream> + +using namespace TNL + +int main() +{ + String str("my world") + int alloc_size = str.getAllocatedSize(); + cout << "alloc_size:" << alloc_size << endl; +} \ No newline at end of file diff --git a/src/Examples/StringExampleGetSize.cpp b/src/Examples/StringExampleGetSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2c30f63a7d30ce31aba6c7b0804dbd7a234509f --- /dev/null +++ b/src/Examples/StringExampleGetSize.cpp @@ -0,0 +1,11 @@ +#include <iostream> + +using namespace TNL + +int main() +{ + String str("my world") + int size = str.getSize(); + cout << "size of string:" << size << "bytes" << endl; +} + diff --git a/src/Examples/StringExampleSetSize.cpp b/src/Examples/StringExampleSetSize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2e53f88b687c8e23278d2c7cac1854d279f8f3ea --- /dev/null +++ b/src/Examples/StringExampleSetSize.cpp @@ -0,0 +1,10 @@ +#include <iostream> + +using namespace TNL + +int main() +{ + int memory + memory.setSize( 256 ); + cout << "memory:" << memory << endl; +}