#include<iostream>
using namespace std;
class Dog
{
public:
char name[
64];
void eat(
char *food)
{
cout << name <<
"吃" << food <<endl;
}
};
void eat(
class Dog &dog,
char *food)
{
cout << dog.name <<
"吃" << food << endl;
}
int main()
{
Dog dog;
strcpy(dog.name,
"狗");
eat(dog,
"翔");
cout <<
"------------" << endl;
dog.eat(
"翔");
return 0;
}
转载请注明原文地址: https://www.6miu.com/read-2300159.html