C++ Standard Library C++ STL Library

C++ <clocale> - localeconv() Function

The C++ <clocale> localeconv() function is used to obtain a pointer to a static object of lconv type, which represents numeric and monetary formatting rules of the current C locale.


struct lconv* localeconv (void);               


No parameter is required.

Return Value

Returns a pointer to the current lconv type with the corresponding values for the current locale filled in.


The example below shows the usage of localeconv() function.

#include <iostream>
#include <clocale>
using namespace std;
int main (){
  setlocale (LC_MONETARY,"en_US.UTF-8");
  struct lconv *lc = localeconv();

  cout<<"Local Currency Symbol: "
  cout<<"International Currency Symbol: "

  return 0;

The output of the above code will be:

Local Currency Symbol: $
International Currency Symbol: USD 

❮ C++ <clocale> Library