[ create a new paste ] login | about

Link: http://codepad.org/bjo4jhtY    [ raw code | output | fork ]

C++, pasted on Jul 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <sstream>
#include <iostream>
using namespace std;

int main()
{
	{
		std::stringstream ss;
		ss << "abcd";
		char buf[1024];
		ss.read(buf, 4);
		std::cout << "EOF: " << std::boolalpha << ss.eof() << std::endl;
	}

	{
		std::stringstream ss;
		ss << "abcd";
		ss.ignore(4);
		std::cout << "EOF: " << std::boolalpha << ss.eof() << std::endl;
	}
}


Output:
1
2
EOF: false
EOF: true


Create a new paste based on this one


Comments: