Hello, heres my code i'm currently ran into some problems and i cant get it to work.
Code:#include <iostream> #include <string> using namespace std; int main() int dan { string mystr; std::cout << "What's your name? "; getline (cin, mystr); if (mystr == dan;) cout << "My name is" << mystr << "too"; std::cout << "Hello " << mystr << ".\n"; std::cout << "What is your favorite team? "; getline (cin, mystr); std::cout << "I like " << mystr << " too!" "\n" << std::endl; std::cout << "My name is Dan and i'm starting using C++!" "\n" << std::endl; std::cout << "Look forward to see more Programming from me :D." "\n" << std::endl; return 0; }
Could someone please tell me why this will not Compile. Heres the Errors that i got back i cant fix themmaybe you could help?
Errors:
P.S I'm using Code::Blocks if that helps.Code:main.cpp:8: error: expected init-declarator before "int" main.cpp:8: error: expected `,' or `;' before "int"
Thanks in advance.
Vash_




maybe you could help?
Reply With Quote