I have gone through other StackOverflow questions but what i need is little different.
I have a long string (probable from some word document) and i want to count the number of characters of the string.
I am copying that long string in my code string s3=<paste the string here>
How do i proceed ahead. I dont need a solution in C++11.
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s1="My test"; //Works
string s2="My" "test"; //Still works
string s3="My"1003"test"; //Doest work. My string being input from user is `My "1003" test`. If i input it in string it becomes "My "1003" test.
cout<<s;
}
Edit : Read the question first adn try to understand what is the catch here instead of blindly suggesting as duplicate. Escaping the character is not handy as the string might comtain a lot of doublw quotes and manually using escape character for double quotes is not handy.