While learning C++ Classes - Basic Inheritance - my program returned an error saying: "C++ forbids comparison between pointer and integer and C++ forbids comparison between pointer and integer". Where did I go wrong? Thanks for your help! :-)
#include <iostream>
using namespace std;
class Pizza
{ public: int slices; char topping[10]; bool pepperoni , cheese ; };
int main() {
// Make your own Pizza!
Pizza pizza;
cout << "\n You can have Cheese or Pepperoni Pizza!";
cout << "\n Type [cheese] or [pepperoni] \n";
cin >> pizza.topping[10];
if (pizza.topping[10] == "pepperoni") { pizza.pepperoni = true;}
if (pizza.pepperoni == true) {cout << "How many slices of pepperoni would you like?";};
if ( pizza.topping[10] == "cheese") { pizza.cheese = true;}
if (pizza.cheese == true) {cout << "How many slices of cheese would you like?";};
cin >> pizza.slices;
if (pizza.slices >= 1) {cout << "You ordered " << pizza.slices << " slices of " << pizza.topping[10] << " Pizza!"; }
else if (pizza.slices <= 0) {cout << "Change your mind?"; }
else { cout <<"Can't Decide? That's Okay.";}
}