Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Realize a function, pass an array with 10 plastic elements, invert the array with a pointer, and output the result of inversion in the main function.
Realize a function, pass an array with 10 plastic elements, invert the array with a pointer, and output the result of inversion in the main function.
# Contains? & ltstdio.h & gt

//? Inverted array

int*? reverseArray(int? arr[],? int? n)

{

int*? rarr? =? New? int[n];

For what? (int? Me? =? 0; ? Me? & lt? n; ? ++i)

*(rarr? +? n? -? Me? -? 1)? =? arr[I]; ?

Return? rarr

}

//? Print array

Invalid? printArray(int? arr[],? int? n)

{

For what? (int? Me? =? 0; ? Me? & lt? n; ? ++i)

printf("%d?" ,? arr[I]);

printf(" \ n ");

}

//? major function

int? Major (invalid)

{

int? arr[ 10]? =? { 1,? 2,? 3,? 4,? 5,? 6,? 7,? 8,? 9,? 10};

printArray(arr, 10);

int*? rarr? =? reverseArray(arr, 10);

printArray(rarr, 10);

Return? 0;

}