Jump to content
Fórum Script Brasil
  • 0

error: dereferencing pointer to incomplete type 'struct Registro'| Por que o valor funciona e o v2 não funciona ? código e imagem abaixo


#include <stdio.h>
#include <stdlib.h>

typedef struct {
 int valor;
 struct Registro * prox;

typedef struct{
 Registro *inicio;
 int tamanho;

Lista * criarLista(){
 Lista *l = malloc(sizeof(Lista));
 l->inicio = NULL;
 l->tamanho = 0;
 return l;

Registro * criarRegistro(int valor){
 Registro *r = (Registro *) malloc(sizeof(Registro));
 r->valor = valor;
 r->prox = NULL;
 return r;
void inserirLista(Lista *L, int valor){
       Registro * r = criarRegistro(valor);
      if(L->tamanho == 0){
          L->inicio = r;
        r->prox = L->inicio;
        L->inicio = r;
void teste(Lista *L){

   int v1 = L->inicio->valor;
   int v2 = L->inicio->prox->valor;

int main()

  Lista *L = criarLista();

  return 0;


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...