country
Returns country-dependent information.
Defined in header <dos.h>
Syntax
#include <dos.h>
struct COUNTRY *country(int xcode, struct country *cp);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
| country specifies how certain country-dependent | data (such as dates, |
times, and currency) will be formatted. The values set by this function depend on the DOS version being used.
If cp has a value of -1, the current country is set to the value of xcode,
| which must be nonzero. Otherwise, the COUNTRY | structure pointed to |
| by cp is filled with the country-dependent | information of the current |
country (if xcode is set to 0), or the country given by xcode.
| The structure COUNTRY | is defined as follows: |
ruct country {
| int co_date; | /*date format */ |
| char co_curr[5]; | /*currency symbol */ |
| char co_thsep[2] | /*thousands separator */ |
| char co_desep[2] | /*decimal separator */ |
| char co_dtsep[2] | /*date separator */ |
| ■ char co_tmsep[2] | /*time separator */ |
char co_currstyl(2; /*currency style */
| char co_diglts; | /*significant digits in currency */ |
| char co_time; | /*time format */ |
| long co_case; | /*case map */ |
| char co_dasep[2] | , /*data separator */ |
| char co_fill[10] | /*filler V |
The date format in cojiate is
B 0 for the U.S. style of month, day, year ■ 1 for the European style of day, month, year B 2 for the Japanese style of year, month, day
Currency display style is given by co_currstyle as follows:
Currency symbol precedes value with no spaces between the symbol and the number.
Currency symbol follows value with no spaces between the number and the symbol.
Currency symbol precedes value with a space after the symbol.
Currency symbol follows the number with a space before the symbol.
Return value
On success, country returns the pointer argument cp. On error, it returns null.
Example
#include <dos.h>
#include <stdio.h>
#define USA 0
int main(void)
{
struct COUNTRY country_info;
country (USA, &country_info);
printfC'The currency symbol for the USA is: *s\n", country_info.co_curr)
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/dos.h/country/
· short form /3.1/country/