I'm doing a project in which the matrix is a land and I have to add ecopoints inside it, and I'm having difficulty putting the function inside the main
#include <stdio.h>
#include <stdlib.h>
function to add an ecopoint to the terrain, x and y is to get the position, "escolha" is to know which of the ecopoints you want to put
void adicionar(int terreno[][], int x, int y, int escolha)
{
printf("Qual é a posição de x?\n");
scanf("%d", &x);
printf("Qual é a posição de y?\n");
scanf("%d", &y);
Printf("Voce Pode Adicionar os seguintes contentores: ");
printf("---------------------------------------------------------\n");
printf("1. Ecoponto papelao\n");
printf("2. Ecoponto vidrao\n");
printf("3. Ecoponto oleao\n");
printf("---------------------------------------------------------");
scanf("%d", &escolha);
switch(escolha)
{
case 1:
terreno[x][y]="papelao";
break;
case 2:
terreno[x][y]="vidrao";
break;
case 3:
terreno[x][y]="oleao";
break;
case 0:
sair();
break;
default:
printf("Digite uma opcao valida\n");
}
}
int main()
{
int continuar=1;
int terreno[1000][1000];
do
{
printf("1. Adicionar Ecoponto\n");
printf("0. Sair\n\n");
scanf("%d", &continuar);
system("cls || clear");
switch(continuar)
{
case 1:
adicionar();
break;
case 0:
sair();
break;
default:
printf("Digite uma opcao valida\n");
}
} while(continuar);
}