Thread: Error : incompatible types with structure

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2020
    Posts
    47

    Error : incompatible types with structure

    Hello,

    I am trying to build a data structure that consists of a single linked list (node_t).

    That for each entry in the list contains a key and a record structure (record_t) which is also a linked list.

    So conceptually:
    - Item 1
    - Record 1
    - Record 2
    - Item 2
    - Record 1
    - Record 2
    - Record 3

    and so on.

    The print_list function is supposed to read through all the records in the data structure and display them.

    Read through the items - while statement - commencing line 28

    Read through the records - while statement - commencing line 36

    but I get a build error on line 41, which is meant to advance to the next record (if it exists)

    Code:
    current->record = current->record.next;
    Code:
    |41|error: incompatible types when assigning to type ‘record_t’ from type ‘struct record *’|
    I don't understand what the compiler is trying to tell me here.

    Thanks

    VW
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 06-01-2015, 07:13 AM
  2. incompatible types error
    By solaris252 in forum C Programming
    Replies: 4
    Last Post: 11-23-2013, 01:21 AM
  3. Getting "incompatible types in assignment error."
    By mgracecar in forum C Programming
    Replies: 1
    Last Post: 02-29-2012, 06:38 PM
  4. Replies: 2
    Last Post: 12-26-2009, 10:07 AM
  5. Incompatible types in assignment error
    By Zildjian in forum C Programming
    Replies: 12
    Last Post: 10-03-2003, 01:15 PM

Tags for this Thread