void *buffer[10];
int size = backtrace(buffer, 10);
char cmd[1024];
sprintf(cmd, "addr2line -f -p -e a.out %p %p %p %p %p %p %p %p %p %p",
buffer[0],
buffer[1],
buffer[2],
buffer[3],
buffer[4],
buffer[5],
buffer[6],
buffer[7],
buffer[8],
buffer[9],
);
I have this code, works most of the time, but sometimes size is less than 10, how to easily print size pointers from an array buffer?
void *?man backtracesuggestedvoid**as the first argument.