// ex_ch10_7.c -- tricks with array elements
#include <stdio.h>

void show_arr(const double ar[], int n);
void copy_arr(const double src[], double dest[], int n);

int main(void)
{
	const double seven[7] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7};
	double three[3];

	show_arr(seven, 7);
	copy_arr(&seven[2], three, 3);
	show_arr(three, 3);
	
	return 0;
}

void copy_arr(const double src[], double dest[], int n)
{
	int i;
	
	for (i = 0; i < n; i++)
		dest[i] = src[i];
}

void show_arr(const double ar[], int n)
{
	int i;
	
	for (i = 0; i < n; i++)
		printf("%.1f  ", ar[i]);
	putchar('\n');
}
