Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6867613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:19:54+00:00 2026-05-27T03:19:54+00:00

I am trying to define two structures in C when the second struct uses

  • 0

I am trying to define two structures in C when the second struct uses the first as an array member and has two pointer members of itself.

Visual Studio does not like my code:

syntax error : ‘}’
syntax error : identifier ‘tokenListNode’
syntax error : missing ‘{‘ before ‘*’

any idea how to solve this?

–> Please note that the errors appear with or without the declarations I added at the beginning of the code.

–> In addition, if someone can explain to me what is the difference between the identifier
before and after the struct’s curly brackets, I’ll be grateful.

Below is the code:

#define ARRAY_SIZE 100

struct tokenListNode;
struct TOKEN_LIST_NODE;


enum TOKEN_TYPE
{
id = 0,
INT_NUM,    
INT_REAL,         
ASSIGNMENT_OP,
RELATION_OP,
ARITHMETIC_OP
} tokenType;

typedef struct TOKEN
{
char* lexema;
enum TOKEN_TYPE type;
int lineNumber;
} token;


typedef struct TOKEN_LIST_NODE
{
token tokenArray[ARRAY_SIZE];
tokenListNode* prevNode;
tokenListNode* nextNode;
int tokenCounter;
}tokenListNode;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:19:54+00:00Added an answer on May 27, 2026 at 3:19 am

    The definition of a structure is composed of the keyword struct; the “struct tag”; and the struct members

    struct tag { int member1; /* &c */ };
    

    You can leave the tag out and create an unnamed structure … why you would do so is another matter: you can’t refer to the structure without a struct tag!

    struct { int member1; /* &c */ };
    

    Also, you can take any type and give it another name using typedef

    typedef old_type new_name;
    

    as in

    typedef struct tag { int member1; /* &c */ } tag;
    /*      <------------ old type ------------> <new name> */
    

    The above line defines a struct (named struct tag) and, at the same time, gives that type a new name: tag

    what is the difference between the identifier before and after the struct’s curly brackets

    That’s the result of mixing definition of struct and typedef. The name before the {} is the “tag” of the structure, the name after the {} is the new name for the type being typedef‘d.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to define two different file extension mappings and two different mime-type IntentFilters
I'm trying to define an XML schema that has an optional tag, sort_expression .
I am trying to define two variables as follows: @orders = Customer.find_all_by_order_date(nil) @nonorders =
I'm trying to define a simple one-to-many relationship between two poco's , using the
I'm trying to create a struct used in two .c source files to make
I'm trying to define the following two keyboard shortcuts to move between windows in
I'm trying to draw two sprites on the same screen. I have defined the
Im trying to define a dataTemplate for a business object in my wpf application
I'm trying to define a task that emits (using echo) a message when a
I'm trying to define a table to store student grades for a online report

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.