#include <bits/stdc++.h>
using namespace std;
class animal { // class
public:
void get_data(string breed, string color, char gender, int age, int cost) {
cout << "Breed:" << breed << "\n" << "Color:" << color << "\n" << "Gender:" << gender << "\n" << "Age:" << age << "\n" << "Cost:" << cost << "\n";
}
} dog, cat; // object
int main()
{
dog.get_data('Chihuahua', 'Brown', 'F', 5, 10000);
cat.get_data('British Shorthair', 'Gray', 'F', 3, 15000);
return 0;
}
Output should be Breed: Chihuahua Color: Brown .... etc.
This code is executing perfectly if I remove the string variables and values.