C Library - <locale.h>



The locale.h header defines the location specific settings, such as date formats and currency symbols. You will find several macros defined along with an important structure struct lconv and two important functions listed below.

Library Macros

Following are the macros defined in the header and these macros will be used in two functions listed below −

Sr.No. Macro & Description
1

LC_ALL

Sets everything.

2

LC_COLLATE

Affects strcoll and strxfrm functions.

3

LC_CTYPE

Affects all character functions.

4

LC_MONETARY

Affects the monetary information provided by localeconv function.

5

LC_NUMERIC

Affects decimal-point formatting and the information provided by localeconv function.

6

LC_TIME

Affects the strftime function.

Library Functions

Following are the functions defined in the header locale.h −

Sr.No. Function & Description
1 char *setlocale(int category, const char *locale)

Sets or reads location dependent information.

2 struct lconv *localeconv(void)

Sets or reads location dependent information.

Advertisements