Data Structures

This is a discussion on Data Structures within the C Programming forums, part of the General Programming Boards category; Hey guys, I'm having a few problems with my data structures. I have a .h and a .c file. Thing ...

  1. #1
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187

    Data Structures

    Hey guys, I'm having a few problems with my data structures.

    I have a .h and a .c file. Thing is I got my data structures defined on my .h with some names in the structures such as node, etc ..
    When calling 'em on my .c file, they all appear as undeclared.

    Any idea why ?

    Thanks, Dean.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    2,919
    Did you include your header file? If you did post the relevant code, along with the complete error message, exactly as it appears in your development environment.

    Jim

  3. #3
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    Yeah I did.

    Error code :
    Code:
    aecfinal2.c: In function ‘alocanamemoriaapartirdotxt’:
    aecfinal2.c:21: error: expected expression before ‘Edge’


    And I declared edge on my .h like this :

    Code:
    typedef Edge *Grafo[MAX];


    The part of code in which I'm getting an error is this one :

    Code:
    Edge *novo;



  4. #4
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    No longer needed, fixed everything.
    Thanks anyway!

  5. #5
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    So, I assume you realised that your typedef was back-to-front?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  6. #6
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    Yeah, I did, haha
    Thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 06-16-2005, 11:03 AM
  2. data structures
    By hawkins786 in forum C++ Programming
    Replies: 1
    Last Post: 05-12-2005, 04:42 PM
  3. Data Structures
    By vex_helix in forum C Programming
    Replies: 2
    Last Post: 04-25-2004, 03:47 PM
  4. Data Structures
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 05-08-2002, 12:12 PM
  5. Data Structures
    By sonicsite in forum C Programming
    Replies: 3
    Last Post: 02-28-2002, 09:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21