请输入您要查询的百科知识:

 

词条 _cgetws
释义

函数简介

函数原型:

wchar_t *_cgetws(

wchar_t *buffer

);

函数功能:

从键盘读入字符串

相关函数:_cgets

所属库:

<conio.h> or <wchar.h>

程序示例

下面的程序示例来自MSDN

#include <conio.h>

#include <stdio.h>

#include <errno.h>

int main( void )

{

char buffer[83] = { 80 }; // Maximum characters in 1st byte

char *result;

printf( "Input line of text, followed by carriage return:\");

// Input a line of text:

result = _cgets( buffer ); // C4996

// Note: _cgets is deprecated; consider using _cgets_s

if (!result)

{

printf( "An error occurred reading from the console:"

" error code %d\", errno);

}

else

{

printf( "\Line length = %d\Text = %s\",

buffer[1], result );

}

}

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/14 1:49:44