ctype::scan_is
找到在与指定的屏蔽的范围的第一个字符。
const CharType *scan_is(
mask maskVal,
const CharType* first,
const CharType* last,
) const;
参数
maskVal
字符将匹配的值的掩码。first
到第一个字符的指针将扫描的范围。last
为字符的指针。在将扫描范围的最后一个字符之后。
返回值
到第一个字符的指针。在与指定的屏蔽的范围。 如果这些值不存在,则函数返回 last.。
备注
成员函数返回maskVal、do_scan_is( first,last)。
示例
// ctype_scan_is.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;
int main( )
{
locale loc1 ( "German_Germany" );
char *string = "Hello, my name is John!";
const char* i = use_facet<ctype<char> > ( loc1 ).scan_is
( ctype_base::punct, string, string + strlen(string) );
cout << "The first punctuation is \"" << *i << "\" at position: "
<< i - string << endl;
}
要求
页眉: <区域设置>
命名空间: std