August 31, 2007 strings | ||||
|---|---|---|---|---|
| ||||
Im just starting with c++.
I run in problems when i write a lot of leteral strings direct into code for
tracing code, like trace("asdadsa add asd");
My program crashes with writing registers atc...
First i didnt know wat is problem but when i just remove all the trace line
program runs ok. I suppose tha i have problem with size of stack .. ?
Is there a way to put such literal strings anywere else to save stack space?
Im developing program wich runs on embedded controller with 16bit dos like OS
(icpdas, MiniOS7) so i have no way to test it on pc. So i need this trace
strings to see what is goign on when something does not do what i whant.
Another question:
Can i run in some troubles with this fnc if i use va_.. macros?
i omited some lines from fnc such as Print-ing out severity and hresult ...
void Logger::Write( char far * message, HRESULT hr, LOG_SEVERITY logSEVERITY,
... )
va_list argptr;
va_start( argptr, logSEVERITY );
char far * line = _str_alloc( strlen(message) + 100 ); //100 should be enough
vsprintf( line, message, argptr );
Print( line );
Print( "\n\r" );
_mfree( line );
va_end(argptr);
}
Thanks for answer very much in advance.
Miro
| ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply