Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
C++中如何阻止用户输入字符串
您好 我对运算符重载相对较新 但我确实相信它是我在制作的几乎每个程序中都遇到的问题的答案 我的目标是超载std cin gt gt int var因此它只能接受整数输入 如果它检测到输入了除 int 之外的输入 它会将用户放入循环中 直到输
c
istream
boost read_until 不会在分隔符处停止
我使用 boost read until 函数来促进通过套接字接收和解析 HTTP 消息 所以我是什么trying要做的就是从套接字中 read until 直到 r n 我认为应该给我一行 HTTP 标头 每个 HTTP 标头行以 r n
c
Sockets
boost
boostasio
istream
通过函数打开流
我需要有关不可复制性质的帮助 io f streams 我需要提供一个黑客包装fstreams 以便在 Windows 上处理文件名中包含 unicode 字符的文件 为此 我设计了一个包装函数 bool open ifstream ist
c
C11
copyconstructor
istream
deletedfunctions
C++ 流混淆:istreambuf_iterator 与 istream_iterator?
有什么区别istreambuf iterator and istream iterator 一般来说 流和streambufs之间有什么区别 我真的找不到任何明确的解释 所以决定在这里询问 IOstreams 使用streambufs 作为
c
istream
streambuf
std::cin 在读取 EOF 并清除后不再读取
Closed 这个问题需要细节或清晰度 help closed questions 目前不接受答案 我正在阅读以下内容std cin with a while循环结束时EOF被介绍 退出循环后 我调用std cin clear 使流恢复正常
c
Buffer
cin
EOF
istream
“抄送”c++ istream?
对于我自己的小解析器框架 我试图定义 类似 以下函数 template
c
Parsing
istream
与我的自定义 Streambuf 类一起使用时,istream::tellg() 返回 -1?
我正在尝试创建一个istream直接从原始内存缓冲区读取 我在这里的另一篇文章中找到了一个很好的方法 class membuf public basic streambuf
c
istream
streambuf
如何实现自定义std::streambuf的seekoff()?
我有以下基于例如的实现这个问题和答案 https stackoverflow com questions 6763646 istreamtellg returns 1 when used with my custom streambuf c
c
istream
seek
streambuf
输入流迭代器和异常
几天前 我正在研究 istream 迭代器和异常处理 我对此感到好奇 include
c
Exception
Iterator
istream
如何从具有 null(0) 字符的 char 数组创建 C++ istringstream?
我有一个 char 数组 其中随机位置包含空字符 我尝试使用此数组 encodedData arr 创建一个 iStringStream 如下所示 我使用此 iStringStream 将二进制数据 Iplimage 的 imagedata
c
istream
Arrays
nullcharacter
C++:ifstream::getline 问题
我正在读取这样的文件 char string 256 std ifstream file file txt open the level file if file check if the file loaded fine error wh
c
fileio
input
ifstream
istream
如何阻止读取 C++ stringstream 以等待数据
因此 我一直试图弄清楚如何等待来自 C stringstream 的数据 例如 而不需要不断检查数据是否存在 这非常消耗 CPU 例如 我完全能够从串行设备读取数据 并在没有数据到达时锁定进程 但不幸的是我无法弄清楚如何使用 C 流来做到这
c
stringstream
istream
istringstream
istream 提取运算符:如何检测解析失败?
如何检测 istream 提取是否失败 string s x stringstream ss s int i ss gt gt std ios hex gt gt i 编辑 虽然问题标题涵盖了这一点 但我忘了在正文中提及 我真的想检测失败是
c
Parsing
istream
有没有办法在地图中进行流式传输?
我有一个文件 其中的映射条目由行分隔 键和值由 分隔 所以类似于 one 1二 2三 3四 4 我在一个名为 dict 的 ifstream 中打开它 然后运行以下代码 string key value map lt string int
c
Dictionary
istream
为什么 std::getline() 在格式化提取后跳过输入?
我有以下一段代码 提示用户输入猫的年龄和名字 include
c
input
iostream
getline
istream
输入迭代器跳过空格,任何方法可以防止这种跳过
我正在从文件读入字符串 直到到达分隔字符 美元符号 但输入迭代器会跳过空格 因此创建的字符串没有空格 在这种情况下不是我想要的 有什么办法可以阻止跳过行为吗 如果是这样怎么办 这是我的测试代码 include
c
istream
istream读取失败后
我有一小段代码来读取用户数据 如下所示 include
c
istream
libc++ 和 libstdc++ 之间的 istream eof 差异
当链接到 libstdc 和 libc 时 以下 玩具 程序返回不同的内容 这是 libc 中的错误还是我不明白 istream eof 的工作原理 我尝试在 linux 和 mac os x 上使用 g 运行它 在 mac os x 上使
c
istream
libstdc
libc
istream::getline 返回类型
什么是istream getline方法返回 我这样问是因为我已经看到要循环遍历文件 应该这样做 while file getline char int handle input 被退回的是什么 它返回一个流 以便我们可以链接操作 但是 当
c
fileio
ifstream
getline
istream
来自 istream 的子流
假设我有一个ifstream它代表一个包含许多聚合在一起的子文件的大文件 我希望能够创建一个 子 istream从较大的ifstream 给定大小和偏移量 表示文件的一部分 以便其他代码可以从该子流中读取 就好像它是一个独立的一样istre
c
file
istream
1
2
»