博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于EOF
阅读量:7048 次
发布时间:2019-06-28

本文共 3117 字,大约阅读时间需要 10 分钟。

hot3.png

相关文章

EOF是什么? - 阮一峰的网络日志

http://www.ruanyifeng.com/blog/2011/11/eof.html


constant

<cstdio>
EOF
End-of-File
It is a macro definition of type int that expands into(扩展成) a negative integral constant expression (generally, -1).
It is used as the value returned by several functions in header <cstdio> to indicate that the End-of-File has been reached or to signal some other failure conditions.
It is also used as the value to represent an invalid character.
In C++, this macro corresponds to the value of char_traits<char>::eof().


class template

<string>

std::char_traits

  • C++98
  • C++11
  •  
template 
struct char_traits;template <> struct char_traits
;template <> struct char_traits
;

Character traits

Character traits classes specify character properties and provide specific semantics for certain operations on characters and sequences of characters.

The standard library includes a standard set of character traits classes that can be instantiated from the char_traitstemplate, and which are used by default both for the  objects and for the  objects. But any other class that follows the requirements of a character traits class can be used instead. This reference attempts to describe both the definition of the standard char_traits and the requirements for custom character traits classes.

 

Template parameters

charT

Character type.

The class defines the standard character traits for this character type.
This shall be one of the types for which an specialization is provided.
Aliased as member type char_traits::char_type.

 

Template specializations

The char_traits standard template supports to be instantiated with at least the following character types:

  • C++98
  • C++11
  •  
type Description
char Basic character set (size of 1 byte)
wchar_t Wide character set (same size, signedness, and alignment as another integral type)

 

Member types

  • C++98
  • C++11
  •  
member type description for character traits types definition
char wchar_t
char_type The template parameter (charT) char wchar_t
int_type Integral type that can represent all charT values, as well as  int wint_t
off_type A type that behaves like  streamoff streamoff
pos_type A type that behaves like  streampos wstreampos
state_type Multibyte transformation state type, such as  mbstate_t mbstate_t

 

Member functions

Compare characters for equality ( public static member function )

Compare characters for inequality ( public static member function )

Get length of null-terminated string ( public static member function )

Assign character ( public static member function )

Compare sequences of characters ( public static member function )

Find first occurrence of character ( public static member function )

Move character sequence ( public static member function )

Copy character sequence ( public static member function )

End-of-File character ( public static member function )

Not End-of-File character ( public static member function )

To char type ( public static member function )

To int type ( public static member function )

Compare int_type values ( public static member function )

转载于:https://my.oschina.net/ray1421/blog/789334

你可能感兴趣的文章
对List遍历过程中添加和删除的思考
查看>>
BZOJ 1003: [ZJOI2006]物流运输
查看>>
BZOJ 1006: [HNOI2008]神奇的国度
查看>>
PHP+mysql系统报错:PHP message: PHP Warning: Unknown: Failed to write session data (files)
查看>>
反向代理负载均衡之APACHE
查看>>
Django 安装
查看>>
jQuery用unbind方法去掉hover事件及其他方法介绍
查看>>
Centos Git1.7.1升级到Git2.2.1
查看>>
linux修改PS1,自定义命令提示符样式
查看>>
ArcMap中,如何查看当前工具是否在执行?如何将工具调到前台来执行?
查看>>
算法题总结----数组(二分查找)
查看>>
OPENWRT make menuconfig错误之一
查看>>
Django框架简介-模型系统
查看>>
可集成到APP的车架号识别软件
查看>>
导出查询结果到csv文件
查看>>
Algs4-2.3.19五取样切分
查看>>
Numpy 数据类型和基本操作
查看>>
HanzFontMaker--支持所有字体的点阵取模软件
查看>>
IDEA常用快揵键
查看>>
git 学习笔记
查看>>