I can't get this to compile using VC++ 5.0:
//ask for person name and generate frame
#include <iostream>
#include <string>
int main()
{
std::cout << "Please enter your first Name: ";
std::string name;
std::cin >> name;
//build the message
const std::string greeting = "Hello, " + name + "!";
//build second line of out put
const std::string spaces (greeting.size(), ' ');
const std::string second = "*" + spaces + " *";
//build 1ST and 5th lines
const std::string first(second.size(), ' '*');
//write it all out
std::cout << std::endl;
std::cout << first << std::endl;
std::cout << second << std::endl;
std::cout << "* " << greeting << " *" << std::endl;
std::cout << second << std::endl;
std::cout << first << std::endl;
return 0;
}
Can Any one help me?
Webcrazy
//ask for person name and generate frame
#include <iostream>
#include <string>
int main()
{
std::cout << "Please enter your first Name: ";
std::string name;
std::cin >> name;
//build the message
const std::string greeting = "Hello, " + name + "!";
//build second line of out put
const std::string spaces (greeting.size(), ' ');
const std::string second = "*" + spaces + " *";
//build 1ST and 5th lines
const std::string first(second.size(), ' '*');
//write it all out
std::cout << std::endl;
std::cout << first << std::endl;
std::cout << second << std::endl;
std::cout << "* " << greeting << " *" << std::endl;
std::cout << second << std::endl;
std::cout << first << std::endl;
return 0;
}
Can Any one help me?
Webcrazy