I dont even know how to word this but... I am trying to make
the program recognize a char and convert it to an int. I want to make the user decide whether the dog is tall or short and depending on the user input it would give cat an int value. What I had in mind for example was, if dog equals Tall or tall then cat equals 1. If dog equals Short or short then cat equals 2. How would I incorporate that in to the code below?
if (dog == 't' || dog == 'T')
if (dog == 's' || dog == 'S')
#include <string> //Include the string library.
string s = ""; //Declare a string s.
cout << "Is the dog tall or short?\n";
cin >> s; //Get word from user and store it in string s.
if(s == "Tall") //Strings go inside double quotes.
dogsize = 2;
elseif(s == "short")
dogsize = 1;