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 9105035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:00:08+00:00 2026-06-17T02:00:08+00:00

I want to define a struct in a flex program : %{ #include <math.h>

  • 0

I want to define a struct in a flex program :

%{

#include <math.h>
#include <string>
#include <vector>
#include <iostream>
#include <map>

struct Node{
    string action;
    vector<Node> vecini[];
};

%}

and even though I include vector and string I still get this errors:
error: ‘string’ does not name a type
error: field ‘vecini’ has incomplete type

Thank you !

  • 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-06-17T02:00:10+00:00Added an answer on June 17, 2026 at 2:00 am

    Both vector and string are in the std namespace so you should add it to the declaration of member variables of those types. Change the code to:

    %{
    
    #include <math.h>
    #include <string>
    #include <vector>
    #include <iostream>
    #include <map>
    
    struct Node{
        std::string action;
        std::vector<Node*> vecini[];
    };
    
    %}
    

    EDIT: (thanks to Kerrek SB): also you can not define a vector of Node as a member of Node. Instead use a vector of pointers to node like so: std::vector<Node*> vecini[];

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

Sidebar

Related Questions

xml_attribute.h #pragma once #ifndef XML_ATTRIBUTET_H #define XML_ATTRIBUTET_H #include <string> #include <iostream> struct XML_AttributeT{ std::string
I want to define an abstract base class with a vector of struct variables,
I want to define a 'node' class/struct and then declare a tree of these
Is this legal and/or good practice? #define SOFTWARE_VERSION_NUMBER 7.0v1.1 Want struct to always contain
I want to define a generic function for printing contents of std::map like types.
I want to define an structure, where some math constants would be stored. Here
I want to sort vector of certain struct with certain order in certain class.
I want to create a tree. I saw the following code #define NODEALLOC(struct treenode*)malloc(sizeof(struct
I want do define an action that sets a property with a value (calculated
I want to change the define $$ as a struct in the following grammar

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.