Witam, mam gotowy program przygotowany w pliku pdf(na studia) i chciałem go przerzucić do CodeBlocks'a żeby zobaczyć jak działa.
Występuje jednak problem, mimo iż przepisałem dokładnie cały kod.
#ifndef EVALEXPRESSION
#define EVALEXPRESSION
int isvalidexpression(const char*str);
int getoperator();
float getfstoperand();
float getsecoperand();
float getexprvalue();
#endif // EVALEXPRESSION
#include<stdio.h>
#include "EVALEXPRESSION.h"
static float f1,f2;
static char op;
int isValidExpression(const char*str)
{
int res;
char ops[10];
res=sscanf(str,"%f %s %f", &f1, ops, &f2);
op=ops[0];
return(res==3);
}
int getOperator()
{
return(op);
}
float getfstoperand()
{
return(f1);
}
float getsecoperand()
{
return(f2);
}