Jump to content
Sign in to follow this  
357mag

How to get the quotation marks to show

Recommended Posts

I want to print a line of text using cout but there is a word that I want to have quotation marks around it. I want the output to look like this:

 

Looking for the index position of the word "own".

 

What I've tried so far has not worked.

 

Here is what I got currently:

 

int main()
{
    string sentence = "To thine own self be true";
    string word = "own";

    cout << "The sentence is: " << sentence << endl;
    cout << "Looking for the index position of the word \"own\";

    cout << sentence.find(word) << endl;

    system("pause");
    return 0;
}

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×