strndup- I need help fot it

558fe5180e0e8fc922d31c23ef84d240


strndup
?

char tav = str[strlen(str)/2+1];
int a,b,anser;
char* as = strndup(str, strlen(str) / 2 - *str);
char* bs = strndup(str+ strlen(str) / 2 - *str+2, strlen(str) / 2 - *str);
a = atoi(as);
b = atoi(bs);
if (tav == '+')
    anser = a + b;
else if (tav == '-')
    anser == a - b;
else if (tav == '*')
    anser == a * b;
else if (tav == '/')
    anser == a / b;

puts(str);