Compass Heading Compiler Error

Hey guys, I needed some code to take a heading and print out the cardinal direction. I get a "error: expected unqualified-id before '[' tokenBad error line: -2" from the IDE compiler. any suggestions? Eventually I would like to have gps feed in the course and print out the direction one day.

char[] getDirection(unsigned long h){
  if(h>337.5){
    return "N";
  else if(h>292.5)
    return "NW";
  else if(h>247.5)
    return "W";
  else if(h>202.5)
    return "SW";
  else if(h>157.5)
    return "S";
  else if(h>112.5)
    return "SE";
  else if(h>67.5)
    return "E";
  else if(h>22.5)
    return "NE";
  else
    return "N";
}

Thanks, -R

change: char[] getDirection(unsigned long h){ to... char *getDirection(unsigned long h){

also, did you want "h" to be a float?

thanks it worked like a champ, and no not a float. the course from the gps gets parsed as an unsigned long but I will have to mess around with it maybe when i actually put the whole project together when my order gets in. just doing some leg work now.

thanks -R

no not a float

So why are you comparing it against decimal fractions?