Ahhhhhhh!!!! >:(

Alrighty so its telling me I'm missing a terminating " character. Its saying its an issue with the "Ah yes" line. I have no idea. All my other lines that are similar go through just fine. this is only a piece out of a work in progress. anyone see the error? I've been staring at this screen way too long hahah XD! Hope someone can figure it out for me because I'm blank lol. Thanks!

1
2
3
4
5
6
7
8
9
10
11
12
13
  std::cin >> name;

    std::cout << "Ah yes " + name; std::cout << "... Then I am surely not mistaken. Are you sure you dont know who I
    am?" << std::endl;

    std::cin >> yes;

    if(no == 1) {
        std::cout << "You Lose!" << endl; return 0;
    }else{
        std::cout << "Well good, then that settles things. Shall we get started?" << std::endl;

    }
Replace:
std::cout << "Ah yes " + name;

With:
std::cout << "Ah yes " << name;
@Stormboy; HAHHAHAHAHA I fail so hard. How did I not try that. I need to go to bed and stop looking at all this damn code lol. Its screwing with my head man! Well thanks a lot. I appreciate it. I knew it was something I was terribly overlooking. Thanks!

-Bleh
@Stormboy; Actually, that didn't work. I have no clue why either. In my head that makes logical sense. Oh well I'm sure ill figure it out tomorrow if someone doesn't figure it out while I'm sleeping. Thanks for trying to help though, I appreciate it!
compiles for me if i put some variable declarations in for yes and no, which by the way, i'm not understanding what they are meant to be doing.
Now that is some weird error you are having there Bleh101. I don't see anything wrong with your code. Is it in any other part of your code? Can you post your full code?
Ummm.....

Strings don't link over lines. If you want a string to continue onto the next line, you either have to seperate it and output two strings, add a backslash at the end to escape the linefeed, or seperate it and concantenate two strings. Here is examples of all three ways:
1
2
3
4
5
6
7
8
std::cout << "long, long string "
          << "continued on next line\n";

std::cout << "long, long string \
continued on next line\n";

std::cout << "long, long string "
             "continued on next line\n";
Last edited on
@NT3; Its the same way for the rest of my dialogue in my code and it works perfectly fine. This line is the one that throws me off. When I take out this line, it builds just fine but whatever is wrong with this line is throwing me for a whirl.

@Stormboy; Ill post a little more of it after I tinker with it a bit tonight after work.

On top of that, I've narrowed it down to what it is. Its somewhere between:

[code]

std::cout << "Ah yes " + name;

So yeah I don't know.
If you break it up into multiple lines, do you still get the error?

1
2
3
std::cout << "Ah yes " + name ;
std::cout << "... Then I am surely not mistaken. Are you sure you dont know" ;
std::cout << "who I am" << std::endl;
Last edited on
Topic archived. No new replies allowed.