I would like to write me own class String which will have interface similar to std::string. String class shall not use dynamic memory allocation.
I need to have a c-tor:
String(char* ptrToFirstCharInTab, char* ptrToLastElementInTab);
And there should be tab which contains different (not know) number of element, so I do not know size while compiling.
In my opinion it's impossible, because if we do not know size of our array before compilation we can not create it without dynamic allocation - of course creating buffer for 500 char and then String class can be only 500 it' not my expections.
Do you have any idea? Maybe is any way to create buffor wchich I will shrink to fit? Thanks for help!