Question
This is a C++ question and development environment is Visual Studio 2015. The code below defines a class CAT that contains a private variable cName[80].
This is a C++ question and development environment is Visual Studio 2015.
The code below defines a class CAT that contains a private variable cName[80]. A function nameSwap() that swaps the name of two cats by using pointers is also defined. Design the nameSwap() function and the main() that will fulfill the following criteria. 1. Create and initialize cName[ ] of two CAT objects in the heap pointed by pA and pB as "Taby" and "Felix" respectively. 2. Show the initial name of the two cats created 3. Swap the name (i.e. string in cName[ ]) of the two cats using the pointer approach (Only swap the name, NOT the object) 4. Show the name again. #define _CRT_SECURE_NO_WARNINGS 1 #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started