www.digitalmars.com         C & C++   DMDScript  

c++.dos.16-bits - strings

reply miro <miro456 pobox.sk> writes:
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 );

Thanks for answer very much in advance.

Aug 31 2007
parent miro <miro456 pobox.sk> writes:
Sorry, i forgot to write more...

dmc cmdline args
-c   -D -g  -x -S -NV -Nc -J -Jm -C -Ae -ml -0 -a1
Aug 31 2007