Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active April 13, 2020 14:59
Show Gist options
  • Save parzibyte/e05d53470df8dbfa27c822be73f74b19 to your computer and use it in GitHub Desktop.
Save parzibyte/e05d53470df8dbfa27c822be73f74b19 to your computer and use it in GitHub Desktop.
char *ecuacion = "x * y * z * pow(x, y)";
// Es importante usar el tipo double, y no float
double x, y, z;
/*
Juntamos las variables del programa con las de la expresión. Nota
que son punteros, así, podemos modificar las variables más tarde pero
la expresión ya estará compilada
*/
te_variable variables[] = {
{"x", &x},
{"y", &y},
{"z", &z},
};
int numeroVariables =
3; // Esto se define manualmente; es la cantidad de variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment