I get an error
Conflicting types for 'free'
to call the free() function below.
int main ( ) { char fx [] = "x^2+5*x-1"; node * fxNode = buildTree(fx, sizeof(fx)/sizeof(char)); printf(deriveFromTree(fxNode));
I canβt understand why. Not sure if this is the case, but above it
#include <stdio.h> char opstack [5] = {'+','-','*','^', '\0'}; unsigned short int lowerOpPrecedence ( char, char, char * ); int stringToUnsignedInt ( char *, unsigned int * ); int stringToDouble ( char * , double * ); unsigned short int stringCompare ( char * , char * ); void stringCopy ( char * , char * ); typedef struct treeNode { char * fx; char * op; struct treeNode * gx; struct treeNode * hx; } node; unsigned short int getNodeState ( node * ); node * buildTree ( char *, int ); char * basicDerivative ( char * ); char * derivateFromTree ( node * );
and below it is a bunch of function implementations.
source share