Hey Bazzy thanks for the help their. So I'm using it as a variable and not a function, I'm sure this will sound soo silly but How do i convert from a variable to a function then?
thanks so much for your help i have spent hours on this
It was declared as int set_team1_score (int); so it must return a value.
If you don't want to return a value, use void as return type but if you do so, cout won't display any value.
I think you want to return f_points_for_team1 after assigning it a new value
How would you perhaps go about incorporating txt in to this class? as I want it to call a name for a team. and Bazzy your a diamond thanks buddy I have managed to finish the class to call back numbers now just need to sort the txt.
As silly as this probably sounds, would you be able to elaborate alittle more on this? would I incorporate this in to my class? perhaps at the begining of the class? and write it in very much the same way as I have written the rest of the class? and thanks again Bazzy, it's much appreciated this help
The thing is I want my program to ask the user to enter a team name, anything he wants to call a team, and then the program takes this data and stores it in the new class i have built and I can call upon it when ever i choose if you get me? I have managed to do that with the numbers just cant seem to get it to implement text. Thanks again
Here is the code so far. I am assuming you mean create string variables like i did for the scores, would they be int? or something else? and Would I be laying out Set_Name like the same as I did for my set_team_scores etc?? just a tad confused still but I am getting their LOl thanks so much, My brain is on over drive with this
#include <iostream>
#include <string>
using namespace std;
I haven't included all my code as don't want to bore you but would i implement the string in to the class very much the same way as I have done here with the scores?
cteams teamscore (0);
cteams team1;
string input;
cout << "Enter a name here ";
getline (cin, input);
team1.set_name (input);
cout << "Team 1 Begins with " << teamscore.get_team1_score () << " Team 2 Begins with " << teamscore.get_team2_score () << endl;
system ("pause");
}
these are the 2 main chunks of my code, the problem im having here is it's saying overload member function not found?? and no appropriate default constructor?? this is getting more and more confusing but I'm getting their with much appreciated help from you guys!!
Bazzy once again, I honestly cannot thank you enough!! It's great to know their are people actually out there willing to help others!
I know I probably sound like a total noob but where others would point and laugh you actually help, Had bad experiences on other forums!!
I just want you to know it's most appreciated!! So thank you.