blak3r
Joined: 11 Jan 2004 Posts: 45
|
Possible to define a var. arg. function in CCS C? |
Posted: Fri Jun 02, 2006 12:33 pm |
|
|
Code: |
#include <stdio.h>
#include <stdarg.h>
int debug( const char* str, ...)
{
if( DEBUG_LOG ) {
va_list ap;
va_start(ap, s);
printf("DEBUG: ");
vprintf(s, ap);
putchar('\n');
va_end(ap);
}
}
|
The code above uses vprintf c libraries to pop the variable arguments off the stack and then print them out. I couldn't find anything similiar in manual or anyone else mentioning it on the forums. Is there anyway to create a function which can take a variable number of arguments in CCS-C?
Thanks,
Blake Robertson _________________ "Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein
http://www.blakerobertson.com |
|