Internationalization and localization tools


Character Manipulation Function

char* _cgets(char* buffer);

wchar_t* _cgetws(wchar_t* buffer);

TCHAR* _cgetts(TCHAR* buffer);

Internationalization (I18n) Function Overview

The _cgets function reads a string of characters from the console, storing the characters in buffer, and returning a pointer to the start of the string, at buffer[2]. Prior to calling the function, buffer[0] must be set to the maximum number of characters to be read. On return, buffer[1] will contain the number of characters read, not counting the terminating null character. buffer must be large enough to hold the string, the terminating null character, and the two size elements. The function reads characters until a carriage return-linefeed (CR-LF) combination is detected, or the specified number of characters (buffer[0]) is read. If the function reads a CR-LF, it stores the null character.

_cgetws is the wide-character version of _cgets; the argument and return are wide-character strings.

_cgetts is the Generic version of the function; with the _MBCS or _UNICODE compiler flags determining its mapping to either _cgets or _cgetws.

See the MSDN Library for further details on this function.

I18n Issues

Use the appropriate version of the function as required for internationalization support.

See Character I/O for a discussion on non-ASCII character input/output in an internationalized application.

Recommended Replacements*

*If you're already using the recommended function, see I18n Issues for other reasons why Globalyzer is detecting the function.

Character Manipulation Functions

 

Lingoport internationalization and localization services and software