Open samrajput1143 opened 10 months ago
//List of supported xApp comp names
XAPP_MAIN, XAPP_RSVD1, XAPP_RSVD2, XAPP_RSVD3, \
XAPP_RSVD4, XAPP_RSVD5, XAPP_E2SM_RC, XAPP_E2SM_KPM}
// Online C compiler to run C program online
void printtoconsloe(const char fmt,const char file, int line,..){ printf("%s %d %s ",file,line,fmt); } int main() { // Write C code here
return 0;
}
getting error
ERROR! gcc /tmp/IueePtgGPl.c -lm /tmp/IueePtgGPl.c:3:21: error: expected parameter name, found "." 3 | #define userlog(fmt,..) printtoconsloe(fmt,FILE,LINE,##__VA_ARGS__) |
---|
#include <stdio.h>
#define userlog2(fmt,...) printtoconsloe2(fmt,##__VA_ARGS__)
void printtoconsloe2(const char * fmt,...){
printf(fmt);
}
int main() {
// Write C code here
userlog2("lol",2,9.0,"kumar");
return 0;
}
how to access and print the arguments (that is 2,9.0,"kumar")we have passed in userlog2 . we are able to print lol but not rest of the arguments
// Macros to be used by xapp users
define USR_LOG_EMERG(comp_name, fmt, ...) \
create_log(0, 1, EMERG, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_ALERT(comp_name, fmt, ...) \
create_log(0, 1, ALERT, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_CRIT(comp_name, fmt, ...) \
create_log(0, 1, CRIT, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_ERROR(comp_name, fmt, ...) \
create_log(0, 1, ERROR, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_WARNING(comp_name, fmt, ...) \
create_log(0, 1, WARNING, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_NOTICE(comp_name, fmt, ...) \
create_log(0, 1, NOTICE, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_INFO(comp_name, fmt, ...) \
create_log(0, 1, INFO, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)
define USR_LOG_DEBUG(comp_name, fmt, ...) \
create_log(0, 1, DEBUG, comp_name, FILE, LINE, fmt, ##__VA_ARGS__)