Declare a character array cArray of length 10.
• Input the values from user.
• Pass that array to a function copy using a pointer.
• Copy the values of cArray in c1Array using dereferencing.
Here is program:
int main()
{
const int size = 10;
int* cArray = new int[size];
int* c1Array = new int[size];
for (int i = 0; i < size; i++)
{
cin >> cArray[i];
}
c1Array = cArray;
}
Comments
Leave a comment