For C et al, here's a quick-n-dirty and highly unsafe cheat that requires Perl:
double eval(const char* expr) {
char buf[1024];
snprintf(buf, sizeof(buf), "perl -e 'print (%s)'", expr);
FILE* p = popen(buf, "r");
double d;
fscanf(p, "%lf", &d);
fclose(p);
return d;
}