#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void testPointing(int size, int** foo);
void initialize(int size, int** foo);

int main() {
	int *end, tam = 5;
	testPointing(tam, &end);

	return (EXIT_SUCCESS);
}

void testPointing(int size, int** foo) {
	initialize(size, foo);

	for (int i = 0; i < size; i++) {
		printf("%d ", (*foo)[i]);
	}
	printf("\n");
}

void initialize(int size, int** foo) {
	int* a = malloc(size * sizeof(int));

	for (int i = 0; i < size; i++) {
		printf("%d ", a[i]);
	}
	printf("\n");
	foo = &a;	// Errado
}

