Help appreciated!

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
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.