C++中的流操纵器的noboolalpha()方法用于获取指定str流的boolapha格式标志的整数值。
用法:
ios_base& noboolalpha (ios_base& str)
参数:此方法接受str作为参数,这是为其获取格式标志的流。
返回值:此方法返回带有noboolalpha格式标志的流str。
范例1:
// C++ code to demonstrate 
// the working of noboolalpha() function 
  
#include <iostream> 
  
using namespace std; 
  
int main() 
{ 
  
    // Initializing the boolean flag 
    bool flag = true; 
  
    // Using noboolalpha() 
    cout << "noboolalpha flag:"
         << noboolalpha << flag << endl; 
  
    return 0; 
}
输出:
noboolalpha flag:1
范例2:
// C++ code to demonstrate 
// the working of noboolalpha() function 
  
#include <iostream> 
  
using namespace std; 
  
int main() 
{ 
  
    // Initializing the boolean flag 
    bool flag = false; 
  
    // Using noboolalpha() 
    cout << "noboolalpha flag:"
         << noboolalpha << flag << endl; 
  
    return 0; 
}
输出:
noboolalpha flag:0
参考: http://www.cplusplus.com/reference/ios/noboolalpha/
相关用法
- C++ ios manipulators oct()用法及代码示例
- C++ ios manipulators right()用法及代码示例
- C++ ios manipulators dec()用法及代码示例
- C++ ios manipulators hex()用法及代码示例
- C++ ios manipulators skipws()用法及代码示例
- C++ ios manipulators internal()用法及代码示例
- C++ ios manipulators fixed()用法及代码示例
- C++ ios manipulators showpos()用法及代码示例
- C++ ios manipulators noshowpoint()用法及代码示例
- C++ ios manipulators left()用法及代码示例
- C++ ios manipulators noskipws()用法及代码示例
- C++ ios manipulators scientific()用法及代码示例
- C++ ios manipulators showbase()用法及代码示例
- C++ ios manipulators noshowbase()用法及代码示例
- C++ ios manipulators nouppercase()用法及代码示例
注:本文由纯净天空筛选整理自guptayashgupta53大神的英文原创作品 ios manipulators noboolapha() function in C++。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
