[ create a new paste ] login | about

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

C++, pasted on Sep 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <algorithm>
#include <iostream>

int main()
{
	const char *foo = "a\r\nb\n";
	std::string s = foo;

	std::cout << "Count: " << std::count(s.begin(), s.end(), '\n') << std::endl;
	std::cout << s;
	
	return 0;

}


Output:
1
2
3
Count: 2
a
b


Create a new paste based on this one


Comments: