Hi all,
Im working in a memory restricted environment and need to create strings dynamically, but still have them not take up heap memory. So does this make sense:
static char staticStringBuffer[10240];
static size_t staticStringWatermark = 0;
void createString( const char * something, const char * somethingElse ) {
char buf[1024];
strcat(buf, "test");
strcat(buf, something);
strcat(buf, somethingElse);
strcat(&staticStringBuffer[staticStringWatermark], buf);
staticStringWatermark += strlen(buf+1);
}
This probably dosent compile, but is what I am attempting sane - sacrificing static memory for heap memory?
Thank-you ^_^