I do not know what means or how to solve it
Here is the Question :
Write function duplicate( int x[],int s) that receives an array of integers, and its size. the
function duplicates all array elements. In the main, let user enters an array of 5 elements, call the
function, then print out the array after calling the function.
here is what i wrote, but it is wrong , since we need one array and it's size in function
any hint what question mean? does it mean that mean if size is 5 i increase it to 10 ?
Here is the Question :
Write function duplicate( int x[],int s) that receives an array of integers, and its size. the
function duplicates all array elements. In the main, let user enters an array of 5 elements, call the
function, then print out the array after calling the function.
here is what i wrote, but it is wrong , since we need one array and it's size in function
#include<iostream> using namespace std; int duplicate(int x[],int s) { #include<iostream> using namespace std; int Duplicate(int x[], int Copyarray[], int s) { int i; for(i=0; i<s; i++) Copyarray[i] = x[i]; return 1; } }
any hint what question mean? does it mean that mean if size is 5 i increase it to 10 ?