well, its not performance ssd though

as has been warned, this is the last time
» Click to show Spoiler - click again to hide... «
// function example
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
string month_w,day, month;
int d,m,h;
#define NEWLINE '\n'
string months(int m);
void output (int m, string name)
{
cout << d << " " << months(m) << endl;
cout << "Your Horoscope is " << name;
cout << NEWLINE;
return;
}
string months(int m)
{
switch (m) {
case 1:
return "January";
break;
case 2:
return "Febuary";
break;
case 3:
return "March";
break;
case 4:
return "April";
break;
case 5:
return "May";
break;
case 6:
return "June";
break;
case 7:
return "July";
break;
case 8:
return "August";
break;
case 9:
return "Semptember";
break;
case 10:
return "October";
break;
case 11:
return "November";
break;
case 12:
return "december";
break;
default:
cout << "error";
}
return "";
}
void help (int m,int d)
{
if(((m==3)&&(21<=d)&&(d<=31))||((m==4)&&(1<=d)&&(d<=19)))
output(m, "'Aries'");
else if(((m==4)&&(20<=d)&&(d<=30))||((m==5)&&(1<=d)&&(d<=20)))
output(m, "'Taurus'");
else if(((m==5)&&(21<=d)&&(d<=31))||((m==6)&&(1<=d)&&(d<=21)))
output(m, "'Gemini'");
else if(((m==6)&&(22<=d)&&(d<=30))||((m==7)&&(1<=d)&&(d<=22)))
output(m, "'Cancer'");
else if(((m==7)&&(23<=d)&&(d<=31))||((m==8)&&(1<=d)&&(d<=22)))
output(m, "'Leo'");
else if(((m==8)&&(23<=d)&&(d<=31))||((m==9)&&(1<=d)&&(d<=22)))
output(m, "'Virgo'");
else if(((m==9)&&(23<=d)&&(d<=30))||((m==10)&&(1<=d)&&(d<=22)))
output(m, "'Libra'");
else if(((m==10)&&(23<=d)&&(d<=31))||((m==11)&&(1<=d)&&(d<=21)))
output(m, "'Scorpio'");
else if(((m==11)&&(22<=d)&&(d<=30))||((m==12)&&(1<=d)&&(d<=21)))
output(m, "'Sagittarius'");
else if(((m==12)&&(22<=d)&&(d<=31))||((m==1)&&(1<=d)&&(d<=19)))
output(m, "'Capricorn'");
else if(((m==1)&&(20<=d)&&(d<=31))||((m==2)&&(1<=d)&&(d<=18)))
output(m, "'Aquarius'");
else if(((m==2)&&(19<=d)&&(d<=31))||((m==3)&&(1<=d)&&(d<=20)))
output(m, "'Pisces'");
return;
}
int main ()
{
cout << "Please key in ur birth of day (1-31) : ";
getline (cin, day);
stringstream(day) >> d;
cout << "please enter your birth of month (1-12) : ";
getline (cin, month);
stringstream(month) >> m;
cout << "You enter : " << m << endl;
help (m,d);
return 0;
}
you can't call month as function since you have define it as variable
and if you want to cout a function, you either need it to change to string, int or etc and return some value respective with the data type.
and you need to passby the data m through the function also.
actually global variable is not that really encouraged.
o i see ..
after this .... where should i go if hv problem ??