const char* lookup(const char* path)
{
const char* MIME = NULL;
const char* first = strchr(path, '.')+2;
const char* last = strrchr(first, ' ');
//(need to declare a type here) len = last - first;
//(need to declare a type here) buf = sizeof(len);
strncpy(buf, first, len);
buf[len] = '\0';
if(strcasecmp(buf , "css") == 0)
{
MIME = "text/css";
return MIME;
}
//Code continues with each MIME type//
I have been writing and rewriting this code. I keep getting errors when I try to compile concerning the type definitions for len and buf. Is this really the problem or is my code completely wrong?