First off my 'if' statement gives me about 60 errors. I think that's got to do with the fact that I'm using "==" and "&&" inside of it. I never remember having those comparative issues like I'm having now, but is there some sort of "#include" file that I'm missing to make those work?
Also, the command window simply closes once the 'cout...A is lying' is printed. I used those 'cin's at the end to get it to stop that, but now that I've put more code it, they don't work. So those are my two issues/questions, and here's my code:
#include "stdafx.h";
#include <iostream>
#include <string>
using namespace std;
int main()
{
int p, q, r,t,f;
cout << "A: 'We are both telling the truth.'";
cin >> p;
cout << endl;
cout << "B: 'A is lying.'";
cin >> q;
cout << endl;
if (p==t && q==f){
cout >> "This is consistent.";
else
cout >> "This is inconsisten.";
}
//waits for user to press a key
cin.ignore();
cin.get();
}
here's the exact error (one of them):
Error 1 error C2784: 'std::basic_istream<_Elem,_Traits> &std::operator >>(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'std::ostream' .... 19

New Topic/Question
Reply



MultiQuote







|