191 static int num_locales =
sizeof(locales) /
sizeof(locales[0]);
193 static int compare(
const void *pkey,
const void *pval)
195 LCID code = *(
const LCID *)pkey;
196 const struct locale *loc = pval;
198 return code - loc->code;
203 LCID code = GetUserDefaultLCID();
205 bsearch(&code, locales, num_locales,
sizeof(locales[0]),
compare);
209 fprintf(stdout,
"%s\n", loc->name);
int compare(const void *a, const void *b)