static function

I have some global map and a global function to find the num of the name.

const std::map<std::string, int> name_to_num_map =
boost::assign::map_list_of("david", 1)
("superman", 2)

int
name_to_num(const char *name)
{
auto it = name_to_num_map.find(name)
return it.second

}


Now this global function needs to be called from a static function of a class register in another file (which has the extern definition for the "name_to_num" func)
How do I call a non-static function in a static function????

class register
{
static get_details(employee)
static get_rank(employee)
}

get_details(employee)
{
Should call name_to_num() here, but how??????
}

Or is there a better way of getting this accomplished????? plz help
Please learn how to use the code tag: [code] put your code here [/code]

Just call the function like normal.
What makes you think that this is a special case? The name_to_num is not a member function. Just call it.
Topic archived. No new replies allowed.