Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » C++ Not Working
- JAVAProgramming
-
Scratcher
100+ posts
C++ Not Working
Hey,
I'm using Microsoft Visual Studio 2013 and none of the code has syntax highlighting (which is annoying and I would like to fix). Code can be found here: http://pastebin.com/9yuZy0W6
I'm also getting an error:
Error 1 error C2679: binary ‘>>’ : no operator found which takes a right-hand operand of type ‘std::string’ (or there is no acceptable conversion)
As far as I'm concerned, cin operates with >> following (just as cout has << after it).
As you can see, I'm a little confused. If you can help in any way, please do.
Thanks
JAVAProgramming
I'm using Microsoft Visual Studio 2013 and none of the code has syntax highlighting (which is annoying and I would like to fix). Code can be found here: http://pastebin.com/9yuZy0W6
I'm also getting an error:
Error 1 error C2679: binary ‘>>’ : no operator found which takes a right-hand operand of type ‘std::string’ (or there is no acceptable conversion)
As far as I'm concerned, cin operates with >> following (just as cout has << after it).
As you can see, I'm a little confused. If you can help in any way, please do.
Thanks
JAVAProgramming
Last edited by JAVAProgramming (July 26, 2014 18:49:10)
- Chainmanner
-
Scratcher
100+ posts
C++ Not Working
If I understand it right, that's a right-shift binary operation, right? If so, then it can't be used on strings, if I'm right.
- astro-mechanic
-
Scratcher
500+ posts
C++ Not Working
If I understand it right, that's a right-shift binary operation, right? If so, then it can't be used on strings, if I'm right.That's the error it's giving, but it's actually supposed to be a stream operator in this case…
- JAVAProgramming
-
Scratcher
100+ posts
C++ Not Working
If I understand it right, that's a right-shift binary operation, right? If so, then it can't be used on strings, if I'm right.I've used it before and it's been fine..
- JAVAProgramming
-
Scratcher
100+ posts
C++ Not Working
Why not use getline(cin, userInput)?I just tried that, and I'm getting: error C3861: ‘getLine’: identifier not found
Do I need to include any other libraries?
- astro-mechanic
-
Scratcher
500+ posts
C++ Not Working
Nope…isn't C++ case sensitive?Why not use getline(cin, userInput)?I just tried that, and I'm getting: error C3861: ‘getLine’: identifier not found
Do I need to include any other libraries?

Last edited by astro-mechanic (July 26, 2014 19:56:59)
- MegaApuTurkUltra
-
Scratcher
1000+ posts
C++ Not Working
Visual Studio is really annoying. You should use Eclipse CDT and MinGW.
- peterkap
-
Scratcher
100+ posts
C++ Not Working
Weird… Hmm, my C++ is a really really rusty, so not sure.
I believe you need
#include <string>
Good luck.
I believe you need
#include <string>
Good luck.
- turkey3
-
Scratcher
1000+ posts
C++ Not Working
Visual Studio is really annoying. You should use Eclipse CDT and MinGW.Visual Studio is not annoying at all. It just takes some getting used to.
- peterkap
-
Scratcher
100+ posts
C++ Not Working
Visual Studio is the best IDE especially for .NET programming languages since it is developed by Microsoft, so of course Visual Studio will always be the IDE that's updated first, and the best choice.Visual Studio is really annoying. You should use Eclipse CDT and MinGW.Visual Studio is not annoying at all. It just takes some getting used to.
Last edited by peterkap (July 27, 2014 01:45:08)
- Znapi
-
Scratcher
500+ posts
C++ Not Working
You need to include the string header to use the data type “string”, which is also why getline() wont work.
- Discussion Forums
- » Things I'm Making and Creating
-
» C++ Not Working