Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

noob question c++

Name: Anonymous 2009-07-12 13:15

Why doesn't this work?

#include <iostream>
using namespace std;
int main(int argc,char** argv){
   string name;
   cout<<"What is your name?"<<endl;
   cin>>name;
   if(name=="Anonymous")
   cout<<"Aw don't be shy..."<<endl;
   else
   cout<<"Hello "<<name<<"!"<<endl
   return 0;
}

Name: Anonymous 2009-07-12 20:38

>>11 here, just to add to this:
Well you see C++ is full of crap like this, so you should just use a proper language like C# or Java.
Except epic failure, because == is NOT overloaded for Java. One of the first pitfalls I ran into with Java was trying to compare strings (and having someone explain to me that the Java VM is fucking stupidly comparing pointers).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List