Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doing some very basic C++ practice.
#1
And I mean very basic because I'm taking an Object Oriented Programming class and it's currently kicking my ass because last time I had C++ was 3 years ago and they'd done an experimental thing by teaching us about Dark GDK instead of actual C++ so I'm horrible at it (and programming in general) and I don't want to hear any talk about that.

Anyway;

Code:
//Include the input/output stream

#include "stdafx.h" //Compiler needs this line, else it's gonna pomegranate everywhere but I have to take it out before submitting to UNIX.
#include <iostream>
using namespace std;

//Main program
//This program will simply display your name after it's been put in.
int main ()
{
    //Declare variables
    string name;

    //Ask for name
    cout << "What is your name? " << endl;
    cin >> name;

    //Display name
    //cout << "Your name is " << name << ", is that correct?" << endl;
    
    return 0;
}

cin >> name; gives me this error;

"error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'const char [2]' (or there is no acceptable conversion)"

Errors are so wordy. Is it a syntax issue?
Reply


Messages In This Thread
Doing some very basic C++ practice. - by MariettaRC - 2013-09-11, 03:32 PM
Doing some very basic C++ practice. - by Dusk - 2013-09-11, 03:45 PM
Doing some very basic C++ practice. - by Fiel - 2013-09-11, 04:39 PM
Doing some very basic C++ practice. - by Dusk - 2013-09-11, 07:03 PM
Doing some very basic C++ practice. - by Locked - 2013-09-11, 08:49 PM
Doing some very basic C++ practice. - by Derosis - 2013-09-13, 07:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)