Hi to everybody, I'm a learner of C++. I'll really appreciate if you can help me or teach me something.
Thank you in advance.
Errors
14 C:\Users\eq1001 2\Documents\Unt itled1.cpp expected unqualified-id before string constant
17 C:\Users\eq1001 2\Documents\Unt itled1.cpp expected unqualified-id before string constant
Thank you in advance.
Code:
#include<iostream>
#include<string>
int main()
{
std::cout << "Introduce your first name:";
std::string name;
std::cin >> name;
//build the message that I intend to write.
const std::string greeting = "Hello, "+name+"!";
//build the space line.
const std::string spaces(greeting.size()." ");
//build the frame of the top/down.
const std::string frame(greeting.size()."*");
//printing the result.
std::cout << std::endl;
std::cout << "*"+frame+"*" << std::endl;
std::cout << "*"+spaces+"*" << std::endl;
std::cout << "*"+greeting+"*" << std::endl;
std::cout << "*"+spaces+"*" << std::endl;
std::cout << "*"+frame+"*" << std::endl;
return 0;
}
14 C:\Users\eq1001 2\Documents\Unt itled1.cpp expected unqualified-id before string constant
17 C:\Users\eq1001 2\Documents\Unt itled1.cpp expected unqualified-id before string constant
Comment