Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't get this to compile using V

Status
Not open for further replies.

webcrazy

Instructor
Dec 24, 1999
14
US
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 << &quot;Please enter your first Name: &quot;;
std::string name;
std::cin >> name;

//build the message
const std::string greeting = &quot;Hello, &quot; + name + &quot;!&quot;;

//build second line of out put
const std::string spaces (greeting.size(), ' ');
const std::string second = &quot;*&quot; + spaces + &quot; *&quot;;

//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 << &quot;* &quot; << greeting << &quot; *&quot; << std::endl;
std::cout << second << std::endl;
std::cout << first << std::endl;

return 0;
}

Can Any one help me?

Webcrazy

 
> const std::string first(second.size(), ' '*');

Should be:

const std::string first(second.size(), '*');


Good luck
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top