Skip to content
Snippets Groups Projects
Commit 329ddc94 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add função para destruir tabuleiro

parent ca850e9f
Branches
No related tags found
No related merge requests found
...@@ -44,3 +44,15 @@ void imprimeTblr(Tblr t) { ...@@ -44,3 +44,15 @@ void imprimeTblr(Tblr t) {
} }
return; return;
} }
bool destroiTblr(Tblr t) {
for(int i=0; i < t->x; ++i) {
for(int j=0; j < t->y; ++j) {
free(t->celulas[i*t->y + j]);
}
}
free(t->celulas);
free(t);
t = NULL;
return true;
}
...@@ -31,4 +31,6 @@ bool leTblr(Tblr t); ...@@ -31,4 +31,6 @@ bool leTblr(Tblr t);
// Imprime o tabuleiro // Imprime o tabuleiro
void imprimeTblr(Tblr t); void imprimeTblr(Tblr t);
bool destroiTblr(Tblr t);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment