Question: 3. Copy a short integer array of certain length . Use the sample code on slide 39 of LectureWeek7and8.pdf as a template. void copy 1
void copy1(short X[], short Y[], int N)
{
int i;
for (i = 0; i < N; i++) {
Y[i] = X[i];
}
}
void copy2(int64_t *Y, int64_t *X, intN)
{
for (int i = 0; i < N; i++) {
*Y++ = *X++;
}
}
Note: The about C function is equivalent to the following C code:
void copy2(int64_t Y[], int64_t X[], intN)
{
for (int i = 0; i < N; i++) {
Y[i] = X[i];
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
