// Program 4.5.1
#include
using namespace std;
int main()
{
char *Animal[ ] = { "checken","cat","camel","horse","rat","crocodile","rabbit"};
cout < "1. animal = " << animal << endl;
cout << "2. animal[1] = " << animal[1] << endl;
cout << "3. animal[2] = " << animal[2] << endl;
cout << "4. animal[6] = " << animal[6] << endl;
cout << "5. *animal = " << *animal << endl;
cout << "6. *animal[1] = " << *animal[1] << endl;
cout << "7. *animal[2] = " << *animal[2] << endl;
cout << "8. *animal[3] = " << *animal[3] << endl;
cout << "9. *(animal+4) = " << *(animal+4) << endl;
cout << "10. animal[2][3] = " << animal[2][3] << endl;
cout << "11. animal[5][5] = " << animal[5][5] << endl;
return 0;
}
task
1. explain in details what the program does?
2.what is the output.
"1.="" animal=" << Animal << endl;
cout << " 2.="" animal[1]=" << Animal[1] << endl;
cout << " 3.="" animal[2]=" << Animal[2] << endl;
cout << " 4.="" animal[6]=" << Animal[6] << endl;
cout << " 5.="" *animal=" << *Animal << endl;
cout << " 6.="" *animal[1]=" << *Animal[1] << endl;
cout << " 7.="" *animal[2]=" << *Animal[2] << endl;
cout << " 8.="" *animal[3]=" << *Animal[3] << endl;
cout << " 9.="" *(animal+4)=" << *(Animal+4) << endl;
cout << " 10.="" animal[2][3]=" << Animal[2][3] << endl;
cout << " 11.="" animal[5][5]=""> "1. animal = " << animal << endl;
cout << "2. animal[1] = " << animal[1] << endl;
cout << "3. animal[2] = " << animal[2] << endl;
cout << "4. animal[6] = " << animal[6] << endl;
cout << "5. *animal = " << *animal << endl;
cout << "6. *animal[1] = " << *animal[1] << endl;
cout << "7. *animal[2] = " << *animal[2] << endl;
cout << "8. *animal[3] = " << *animal[3] << endl;
cout << "9. *(animal+4) = " << *(animal+4) << endl;
cout << "10. animal[2][3] = " << animal[2][3] << endl;
cout << "11. animal[5][5] = " << animal[5][5] << endl;
return 0;
}
task
1. explain in details what the program does?
2.what is the output.
>