Error: invalid array assignment

replace it with

const char *tempstr = NULL;