Tech^salvager
07-19-2004, 01:56 AM
Hi all, well I needs some help with Kdevelop it's my first time using it and I was trying to build project when it reported back errors. Is there something I have to do to use strings in my code? Dev-C++ was alot easier then this but I guess thats the trade off when you go to linux.
//************************************************** ************************************************** ********************************************
//FormLetter program
//This program prints a form letter for a promotinal contest.
//It uses the four parts of a name to build name strings in four
//different formats to be used in personalizing the letter
//************************************************** ************************************************** ********************************************
#include <iostream>
#include <strings>
using namespace std;
const string TITLE = "Mr.";
const string FIRST_NAME = "John";
const string MIDDLE_INITAL = "T";
const string LAST_NAME = "Barrera";
int main()
{
string first;
string fullName;
string firstLast;
string titleLast;
first = FIRST_NAME + " ";
fullName = TITLE + " " + first + MIDDLE_INITAL;
fullName = fullName + ". " + LAST_NAME;
firstLast = first + LAST_NAME;
titleLast = TITLE + " " + LAST_NAME;
cout << fullName " is a GRAND PRIZE WINNER!!!!!!" << endl << endl;
cout << " Dear " << titleLast << "," << endl << endl;
cout << "Yes it's true! " << firstLast << " has won our" << endl;
cout << "GRAND PRIZE - your choice of a 42-INCH* COLOR" << endl;
cout << "TELEVISION or a FREE WEEKEND IN NEW YORK CITY.***" << endl;
cout << "ALL that you haveto do to collect your prize is" << endl;
cout << "attend one of our fun-filled all-day presentations" << endl;
cout << "on the bebfits of owning a timeshare condominium" << endl;
cout << "trailer at the /happy Acres Mobile Campground in" << endl;
cout << "beautiful Panhard, Texas! Now " << first << "I realize" << endl;
cout << "that the three hour drive from the nearest airport" << endl;
cout << "to Panhard may seem daunting at first, but isn't" << endl;
cout << "it worth a little extra effort to recive such a" << endl;
cout << "FABULOUS PRIZE? So why wait? Give us a call right" << endl;
cout << "now to schedule your visit and collect your" << endl;
cout << "GRAND PRIZE!" << endl << endl;
cout << "Most Sincerely," << endl << endl;
cout << "Argyle M. Sneeze" << endl << endl << endl << endl;
cout << "*Measured around the circumference of the packing" << endl;
cout << "crate. ** Includes air fare and hotel accommodations." << endl;
cout << "Departure from home, Alaska; surharge applies to" << endl;
cout << "other departure airports. Accommadations within" << endl;
cout << "driving distance of New York City at the the Cheap-o-tel" << endl;
cout << "in Plattsburgh, NY." << endl;
return 0;
}
EDIT: I found about the #include <strings> mess up and change it back to #include <string> but I am still getting errors here is the output when I Build Project
*cd "/home/justin/form2/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
*/home/justin/form2/src/form2.cpp:33: error: syntax error before string constant
*/home/justin/form2/src/form2.cpp:58:2: warning: no newline at end of file
**** Exited with status: 2 ***
Thank you for your help
Tech^:t
//************************************************** ************************************************** ********************************************
//FormLetter program
//This program prints a form letter for a promotinal contest.
//It uses the four parts of a name to build name strings in four
//different formats to be used in personalizing the letter
//************************************************** ************************************************** ********************************************
#include <iostream>
#include <strings>
using namespace std;
const string TITLE = "Mr.";
const string FIRST_NAME = "John";
const string MIDDLE_INITAL = "T";
const string LAST_NAME = "Barrera";
int main()
{
string first;
string fullName;
string firstLast;
string titleLast;
first = FIRST_NAME + " ";
fullName = TITLE + " " + first + MIDDLE_INITAL;
fullName = fullName + ". " + LAST_NAME;
firstLast = first + LAST_NAME;
titleLast = TITLE + " " + LAST_NAME;
cout << fullName " is a GRAND PRIZE WINNER!!!!!!" << endl << endl;
cout << " Dear " << titleLast << "," << endl << endl;
cout << "Yes it's true! " << firstLast << " has won our" << endl;
cout << "GRAND PRIZE - your choice of a 42-INCH* COLOR" << endl;
cout << "TELEVISION or a FREE WEEKEND IN NEW YORK CITY.***" << endl;
cout << "ALL that you haveto do to collect your prize is" << endl;
cout << "attend one of our fun-filled all-day presentations" << endl;
cout << "on the bebfits of owning a timeshare condominium" << endl;
cout << "trailer at the /happy Acres Mobile Campground in" << endl;
cout << "beautiful Panhard, Texas! Now " << first << "I realize" << endl;
cout << "that the three hour drive from the nearest airport" << endl;
cout << "to Panhard may seem daunting at first, but isn't" << endl;
cout << "it worth a little extra effort to recive such a" << endl;
cout << "FABULOUS PRIZE? So why wait? Give us a call right" << endl;
cout << "now to schedule your visit and collect your" << endl;
cout << "GRAND PRIZE!" << endl << endl;
cout << "Most Sincerely," << endl << endl;
cout << "Argyle M. Sneeze" << endl << endl << endl << endl;
cout << "*Measured around the circumference of the packing" << endl;
cout << "crate. ** Includes air fare and hotel accommodations." << endl;
cout << "Departure from home, Alaska; surharge applies to" << endl;
cout << "other departure airports. Accommadations within" << endl;
cout << "driving distance of New York City at the the Cheap-o-tel" << endl;
cout << "in Plattsburgh, NY." << endl;
return 0;
}
EDIT: I found about the #include <strings> mess up and change it back to #include <string> but I am still getting errors here is the output when I Build Project
*cd "/home/justin/form2/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
*/home/justin/form2/src/form2.cpp:33: error: syntax error before string constant
*/home/justin/form2/src/form2.cpp:58:2: warning: no newline at end of file
**** Exited with status: 2 ***
Thank you for your help
Tech^:t