Hi,
I've made a vPrint function that I want to share with you.
I makes my life a little easier, maybe you find it useful too.
Call like this:
vPrint("sample string with variable inputs, %d, %.3f, %s", iBars(Symbol(), PERIOD_D1), 3.1415926, "Hello world");
Code:
void vPrint(char *format, ...)
{
va_list args;
char *msg;
int len;
va_start (args, format);
len = _vscprintf(format, args) + 1;
msg = (char *)malloc(len * sizeof(char));
vsprintf_s(msg, len, format, args);
va_end (args);
Print(msg);
free (msg);
}
Useful function vPrint(format, ...)
-
- Posts: 905
- Joined: Sat Jul 11, 2009 10:54 am
Who is online
Users browsing this forum: No registered users and 20 guests