   Problem with a program in a tutorial
  OK I posted a message on here about a week ago and asked people what I should learn after a little qbasic, and I got alot of replies saying C++. So naturally I went with what most people said(c++). So I got my c++ compiler from bloodshed.net, and I got my tutorials. Now I started c++ about 3 days ago and ive read 2 tutorials now. I got them from www.gametutorials.com and when I compile the program in their second tutorial im getting a error. The program asks for your name but for some reason im getting an error when I compile it. I was wondering if someone could take about 5 seconds and write ou the propper program to Ask a person for their name then print "hello" szname; or somethin like that. I would appreciate it alot, I dont want to go on before I know whats causing the error. I dont really want to read thier tutorials if they are crap. Any replies are appreciated. p.s. I would write out the script they had but im not on my home computer and i dont remember it all. Ill post it later if its needed.-anthony 
  In C:#include <stdio.h>int main(){    char name[101];    printf("Please enter your name: ");    scanf("%s", name);    printf("Hello, %s!\n");    return 0;}  In C++:#include <iostream>#include <string>int main(){    std::string name;    std::cout << "Please enter your name: ";    std::cin >> name;    std::cout << "Hello, " << name << endl;    return 0;}  "For crying out loud, she has fishes coming out of her head on either side. How can you find this hot?!""If anyone sees a suspicious, camouflaged factory being carried across the desert, they should report it immediately."    ;  ok cool ill run it when i get home and see how it does. I was wondering what the std: was for because in the tutorials ive read It doesnt say anything abotu using those(I do know is stands for standard but thats it). If you know where I can get some better material to read than the stuff at www.gametutorials.com please let me know. Thanks for the post  [edited by - anthonyrh1 on July 31, 2003 3:22:09 PM];  Get a book, like Dietel & Dietel C++ book, pretty good for a beginner.There''s a copy of Learning C++ in 21 days free on the internet too.. google for it. ;  Post the code that was giving you problems.-- Steve -- ;  If you want it to print your first, middle, and last name then use this one:#include <iostream>#include <string>using namespace std;int main(){    string name;    cout << "Please enter your name: ";    getline(cin, name);    cout << "Hello, " << name << endl;    return 0;}    There might be things wrong with it, because I had to write it fast [edited by - Bakingsoda36 on July 31, 2003 10:29:16 PM];  #include <iostream>#include <string> using namespace std; void main(){   cin >> szName; cout << "Hello " << szName << endl; } ;quote:Original post by Anthonyrh1    #include <iostream>#include <string> using namespace std;void main(){   cin >> szName;cout << "Hello " << szName << endl; }   For that to work you will need to declare szName as a string. Like this:#include <iostream>#include <string>using namespace std;int main(){string szName;    cin >> szName;   cout << "Hello " << szName << endl;   return 0;}    [edited by - Bakingsoda36 on July 31, 2003 10:44:24 PM]