Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAT_tpCondRet MAT_CriarMatriz(MAT_tpMatriz** matriz, int n) {
- int i;
- MAT_tpMatriz* pMatriz = NULL;
- MAT_tpNoMatriz* noTemp = NULL;
- if (matriz* != NULL )
- {
- MAT_DestruirMatriz(matriz*) ;
- } /* if */
- pMatriz = ( MAT_tpMatriz* ) malloc( sizeof( MAT_tpMatriz )) ;
- if ( pMatriz == NULL )
- {
- return MAT_CondRetFaltouMemoria ;
- } /* if */
- pMatriz->NosMatriz = (MAT_tpNoMatriz**) malloc(sizeof(MAT_tpNoMatriz*) * n * n);
- if(pMatriz->NosMatriz == NULL) {
- return MAT_CondRetFaltouMemoria;
- }
- for (i = 0; i < n * n; i++)
- {
- pMatriz->NosMatriz = NULL;
- }
- pMatriz->pNoOrigem = pMatriz->NosMatriz[0];
- pMatriz->pNoCorr = pMatriz->NosMatriz[0];
- matriz* = pMatriz;
- return MAT_CondRetOK ;
- } /* Fim função: MAT Criar Matriz */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement