I'm having some problems with a class and it's members, I don't know how to return the values.
1 2 3 4 5 6 7 8 9 10 11 12
class CLASS
{
public:
void MEMBER(std::string, int);
}
void CLASS::MEMBER(std::string NAME, int AGE)
{
if (AGE > 18)
NAME += " is an adult.";
else
NAME += " is a child.";
}
I changed NAME, but that doesn't change the value the user sent originally.
1 2 3 4
CLASS Shay9999;
string myname = "Stan Marsh";
Shay9999.MEMBER(myname, 15);
cout<<myname;
When I add a return to it
1 2 3
...else
NAME += " is a child.";
return (NAME);
I get an error that Void is trying to return a value.
I just used them as an example =P and because I'm using a library called SFML, and I want to be able to enter an empty sprite and after it runs through, it becomes filled with an image.
Now that I added the '&' (xD), I'm having some problems altering images. It seems to get a white screen where the image would normally be located. Should I be asking this on the SFML forums, or does somebody here know (^_^)?
The code you have posted has absolutely nothing to do with SFML, or images either. Please post the code you believe is causing the problem (perhaps the code that does stuff with your image...).