#ifndef W_H_
#define W_H_
#endif
class whateyva
{
int neg;
int pos;
int tot;
void bal(){ tot = neg + pos;}
public:
whateyva();
whateyva(int x, int y);
int addpos(int);
int addneg(int);
void stot();
};
#include <iostream>
#include "w.h"
usingnamespace std;
int main()
{
whateyva mood;
do
{
int count = 0;
cout << "Anything ";
if(count > 0)
cout << "else ";
cout << "happen to you today? [y/n] > ";
char occur;
cin >> occur;
occur = tolower(occur);
if(occur == 'n')
break;
mood(0, 0);
cout << "Good [g] or bad [b]? >";
char ooo;
cin >> ooo;
if(ooo == 'g')
mood.addpos(5);
else
mood.addneg(5);
}while(true);
cout << stot() << " is your balance of moods today. ";
cin.get();
cin.get();
}
Saye stot() is undeclared, and
"no match for call to (whateyva) (int, int)"
I have absolutely no idea.
I've checked my sources and it appears my syntax is ok. Any ideas?
wuse.cpp line 20: I don't think you can call a constructor that way; I believe you have to call it when creating the instance or not at all.
wuse.cpp line 29: stot() is not a global function, so you have to call it like so: mood.stot();
Putting it inside of a cout statement is also wrong since the function does the output itself and does not return a value.