tags:

views:

111

answers:

2

does line.length(); include end line chars?

For example

Hello World

How long would this be 11 or 12?

+3  A: 
std::string s1 = "Hello World\n";
std::cout << s1.length() << std::endl;

This prints 12. The new line is included in the length.

Starkey
+3  A: 
GG