Search code examples
cgccmatrixcompilationheader

How to properly make a header for a C function that receives a matrix


I'm trying to compile a C function that receives an static matrix and i want to make a header file for it. How should i define it? I tried this but i'm getting conflicting types error.

This is my header file

nodo* construirArbol(int,int ,float **,nodo *,int);

This is the "header" in the .c file

nodo* construirArbol(int filas,int columnas,float matriz[][columnas],nodo *n,int iterador){

I've tried this but i don't know if its a correct solution

nodo* construirArbol(int,int c,float [][c],nodo *,int); Both of two first arguments are the rows and colums of the matrix

All help is welcome


Solution

  • You do not have to use square brackets to represent a matrix as a parameter for the function. On the other hand, when it comes to the matrix manipulations in the function definition feel free to use ones.