Follow an implementation capable of solving your problem:
#include <stdio.h>
#include <stdlib.h>
typedef struct elemento_s elemento_t;
typedef struct matriz_s matriz_t;
struct elemento_s
{
    int valor;
    elemento_t * abaixo;
    elemento_t * direita;
};
struct matriz_s
{
    elemento_t * inicio;
    int linhas;
    int colunas;
};
matriz_t * matriz_criar( int linhas, int colunas )
{
    int l = 0;
    int c = 0;
    elemento_t * esq = NULL;
    elemento_t * prim = NULL;
    elemento_t * ant = NULL;
    elemento_t * inicio = NULL;
    for( l = 0; l < linhas; l++ )
    {
        esq = NULL;
        for( c = 0; c < colunas; c++ )
        {
            elemento_t * el = (elemento_t*) calloc( 1, sizeof(elemento_t) );
            el->valor = 0;
            if( !inicio )
                inicio = el;
            if( esq )
                esq->direita = el;
            esq = el;
            if( ant )
            {
                int i = 0;
                elemento_t * aux = ant;
                for( i = 0; i < c; i++ )
                    aux = aux->direita;
                aux->abaixo = el;
            }
            if( c == 0 )
                prim = el;
        }
        ant = prim;
    }
    matriz_t * m = (matriz_t*) calloc( 1, sizeof(matriz_t) );
    m->inicio = inicio;
    m->colunas = colunas;
    m->linhas = linhas;
    return m;
}
void matriz_destruir( matriz_t * m )
{
    elemento_t * ec = m->inicio;
    elemento_t * el = NULL;
    elemento_t * aux = NULL;
    while( ec )
    {
        el = ec->direita;
        while(el)
        {
            aux = el->direita;
            free(el);
            el = aux;
        }
        aux = ec->abaixo;
        free(ec);
        ec = aux;
    }
    free(m);
}
elemento_t * matriz_obter_elemento( matriz_t * m, int col, int linha )
{
    int i = 0;
    elemento_t * e = m->inicio;
    for( i = 0; i < linha; i++ )
        e = e->abaixo;
    for( i = 0; i < col; i++ )
        e = e->direita;
    return e;
}
void matriz_setar_elemento( matriz_t * m, int col, int linha, int valor )
{
    elemento_t * e = matriz_obter_elemento( m, col, linha );
    e->valor = valor;
}
void matriz_debug( matriz_t * m )
{
    int l = 0;
    int c = 0;
    printf("matriz=%p, colunas=%d, linhas=%d, inicio=%p\n", m, m->colunas, m->linhas, m->inicio );
    for( l = 0; l < m->linhas; l++ )
    {
        for( c = 0; c < m->colunas; c++ )
        {
            elemento_t * e = matriz_obter_elemento( m, c, l );
            printf("    col=%d, linha=%d, elemento=%p, abaixo=%p, direita=%p, valor=%d\n", c, l, e, e->abaixo, e->direita, e->valor );
        }
    }
}
int main( void )
{
    int qtd_linhas = 3;
    int qtd_colunas = 5;
    /* Criando Matriz */
    matriz_t * m = matriz_criar( qtd_linhas, qtd_colunas );
    /* Preenchendo Elementos da Linha 0 */
    matriz_setar_elemento( m, 0, 0, 10 );
    matriz_setar_elemento( m, 1, 0, 20 );
    matriz_setar_elemento( m, 2, 0, 30 );
    matriz_setar_elemento( m, 3, 0, 40 );
    matriz_setar_elemento( m, 4, 0, 50 );
    /* Preenchendo Elementos da Linha 1 */
    matriz_setar_elemento( m, 0, 1, 60 );
    matriz_setar_elemento( m, 1, 1, 70 );
    matriz_setar_elemento( m, 2, 1, 80 );
    matriz_setar_elemento( m, 3, 1, 90 );
    matriz_setar_elemento( m, 4, 1, 100 );
    /* Preenchendo Elementos da Linha 2 */
    matriz_setar_elemento( m, 0, 2, 110 );
    matriz_setar_elemento( m, 1, 2, 120 );
    matriz_setar_elemento( m, 2, 2, 130 );
    matriz_setar_elemento( m, 3, 2, 140 );
    matriz_setar_elemento( m, 4, 2, 150 );
    /* Debug da Matriz */
    matriz_debug(m);
    /* Destruindo Matriz */
    matriz_destruir(m);
    return 0;
}
Testing:
$ ./matriz
matriz=0xef11f0, colunas=5, linhas=3, inicio=0xef1010
    col=0, linha=0, elemento=0xef1010, abaixo=0xef10b0, direita=0xef1030, valor=10
    col=1, linha=0, elemento=0xef1030, abaixo=0xef10d0, direita=0xef1050, valor=20
    col=2, linha=0, elemento=0xef1050, abaixo=0xef10f0, direita=0xef1070, valor=30
    col=3, linha=0, elemento=0xef1070, abaixo=0xef1110, direita=0xef1090, valor=40
    col=4, linha=0, elemento=0xef1090, abaixo=0xef1130, direita=(nil), valor=50
    col=0, linha=1, elemento=0xef10b0, abaixo=0xef1150, direita=0xef10d0, valor=60
    col=1, linha=1, elemento=0xef10d0, abaixo=0xef1170, direita=0xef10f0, valor=70
    col=2, linha=1, elemento=0xef10f0, abaixo=0xef1190, direita=0xef1110, valor=80
    col=3, linha=1, elemento=0xef1110, abaixo=0xef11b0, direita=0xef1130, valor=90
    col=4, linha=1, elemento=0xef1130, abaixo=0xef11d0, direita=(nil), valor=100
    col=0, linha=2, elemento=0xef1150, abaixo=(nil), direita=0xef1170, valor=110
    col=1, linha=2, elemento=0xef1170, abaixo=(nil), direita=0xef1190, valor=120
    col=2, linha=2, elemento=0xef1190, abaixo=(nil), direita=0xef11b0, valor=130
    col=3, linha=2, elemento=0xef11b0, abaixo=(nil), direita=0xef11d0, valor=140
    col=4, linha=2, elemento=0xef11d0, abaixo=(nil), direita=(nil), valor=150
							
							
						 
Using pointers to the next line or with pointers to the 4 consecutive elements. Where did you stop when trying to solve this problem?
– Jefferson Quesado
Your matrix definition is very safe. I just think it’s weird that you can only operate by going right and down, but it’s plausible anyway
– Jefferson Quesado
But what you can’t do?
– Isac