Here's a small test program that demonstrates what I'm experiencing. I'm building it with gcc 4.2.1.
#include <stdarg.h>
#include <stdlib.h> ...
Type: Posts; User: fredb
Here's a small test program that demonstrates what I'm experiencing. I'm building it with gcc 4.2.1.
#include <stdarg.h>
#include <stdlib.h> ...
The log function uses base e and you want base 10. The conversion is log(x) / log(10)
I trust that despite rules to the contrary that it's OK to post here.
To address your first concern, it's a simple matter to malloc the buffer to hold the result. The function result now indicates...
My vast apologies for the error. The thread was rather near the top of the list while looking at the New Posts. Quickly scanning the date of the post prior to mine shows a date of 4/20--I must have...
Just for grins and because I actually enjoy parsing text, here's my rewrite of a better strtok.
char *better_strtok(char *str, char *delim, char *result, int nresult) {
char *start = str;...