首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::fpos::state

State state() const;

(1)

?

void state( State st );

(2)

?

管理文件位置状态。

1%29返回文件位置状态的值。

2%29将文件位置状态替换为st...

专门化的std::fpos在标准库中使用,State总是std::mbstate_t...

参数

st

-

new value for the state

返回值

1%29 fpo状态的当前值

2%29%280%29

二次

代码语言:javascript
复制
#include <iostream>
#include <sstream>
#include <cwchar>
 
int main()
{
    std::istringstream s("test");
    std::mbstate_t st = s.tellg().state();
 
    if(std::mbsinit(&st))
        std::cout << "The stream is in the initial shift state\n";
}

二次

产出:

二次

代码语言:javascript
复制
The stream is in the initial shift state

二次

另见

mbstate_t

conversion state information necessary to iterate multibyte character strings (class)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com