Help appreciated!

Feb 19, 2018 at 1:48pm
So I have a string called "A" that I wanna compare to a number of strings.


something like this
1
2
3
4
   String a;
   a = "fruit";
   if(a == "fruit" or "berry" or "lime" or "lemon")
      cout << "success";


This obviously wont work but how would you approach this problem?
Last edited on Feb 19, 2018 at 1:48pm
Feb 19, 2018 at 1:51pm
1
2
3
4
   String a;
   a = "fruit";
   if(a == "fruit" or a =="berry" or a =="lime" or a =="lemon")
      cout << "success";
Topic archived. No new replies allowed.