Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > help with Borland C++ V.4.52

Reply
Thread Tools

help with Borland C++ V.4.52

 
 
tvn007@hotmail.com
Guest
Posts: n/a
 
      10-28-2005
I could not get this program to run in Borland C++ V.4.52.
Error message: "size is not member of string in function main()"
However, this program run fine on g++.
Thanks for any help !
################################################## #####
#include <iostream.h>
#include <string.h>
#include <cstring.h>

int main()
{
cout << "Please enter your first name: ";
string name;
cin >> name;

// build the message that we intend to write
const string greeting = "Hello, " + name + "!";

// build the second and fourth lines of the output
const string spaces(greeting.size(), ' ');
const string second = "* " + spaces + " *";

// build the first and fifth lines of the output
const string first(second.size(), '*');

// write it all
cout << std::endl;
cout << first << std::endl;
cout << second << std::endl;
cout << "* " << greeting << " *" << std::endl;
cout << second << std::endl;
cout << first << std::endl;

return 0;
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Borland C++ 5.5 tiny memory model dhruba.bandopadhyay@hotmail.com C++ 0 08-06-2007 08:37 AM
QUERY: Borland C++ 4.5 vs Borland Turbo C++ 1.01 dhruba.bandopadhyay@hotmail.com C++ 1 10-02-2006 10:57 AM
help with Borland C++ V.4.52 tvn007@hotmail.com C++ 2 10-28-2005 09:55 PM
Borland C++ to Visual Studio =?Utf-8?B?RHJpa3Vz?= ASP .Net 3 08-08-2005 08:36 PM
Conversion MS VS.NET 2003 - Borland C#Builder Piotr Karwatka ASP .Net 1 12-15-2004 10:20 PM



Advertisments