1 MAJOR error that keeps me struggling!!
Nov 17, 2010 at 12:53am UTC
Here is a bit of code that will give me the error: "no match for 'operator==' in 'addphoto == true' " and errors which resembles it ex. "no match for 'operator==' in 'addvideo == true' "
NEED HELP!!!
heres the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
#include <iostream>
using namespace std;
int main(){
string useradd=false ;
string username;
string addphoto=false ;
string addvideo=false ;
string addcomment=false ;
string useruploadchoise;
int user_luckypoints=0;
int video_points=10;
const int video_add=1;
int video_max=6;
//---------------
int comment_points=2;
int comment_max=500;
const int comment_add=1;
//----------------
int photo_points=4;
int photo_max=10;
const int photo_add=1;
cout << "What is a user Name of you choise!" ;
cin >> username;
cout << "What do you wish to do:\nA)upload photos\nB)upload Videos\nC)upload comment" ;
cin >> useruploadchoise;
if (useruploadchoise=="A" ,"a" ){
addphoto=true ;
useradd=true ;
}
if (useruploadchoise=="B" ,"b" ){
addvideo=true ;
useradd=true ;
}
if (useruploadchoise=="C" ,"c" ){
addcomment=true ;
useradd=true ;
}
if (useradd==true ){
if (addphoto==true ){
photo_max=-photo_add;
user_luckypoints=+photo_points;
if (photo_max==0){
photo_points=0;
}
addphoto=false ;
useradd=false ;
}
if (addvideo==true ){
video_max=-video_add;
user_luckypoints=+video_points;
if (video_max==0){
video_points=0;
}
addvideo=false ;
useradd=false ;
}
if (addcomment==true ){
comment_max=-comment_add;
user_luckypoints=+comment_points;
if (comment_max==0){
comment_points=0;
}
addcomment=false ;
useradd=false ;
}
}
if (user_luckypoints==500){
cout << "YOU WIN!!" ;
cout << username << " the group admin will be notified about your winning!!" ;
}
system("pause" );
return 0;
}
(Please do not copy my code xDD lolllz
Nov 17, 2010 at 12:57am UTC
The declarations of useradd, addphoto, addvideo, and addcomment should be:
1 2 3 4
bool useradd=false ;
bool addphoto=false ;
bool addvideo=false ;
bool addcomment=false ;
Note that they are bools, not Strings.
Nov 17, 2010 at 1:18am UTC
Also
1 2
//if(useruploadchoise=="A","a")
if (useruploadchoise=="A" or useruploadchoise=="a" )
Topic archived. No new replies allowed.