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

  • Home
  • SEARCH
  • 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 8595565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:27:58+00:00 2026-06-12T00:27:58+00:00

the following is my index.h class class index { struct node { string item;

  • 0

the following is my index.h class

class index
{

struct node {
        string item;
        int counter;
        vector<int> pageNumber;
    };

public:
    node* newNode (string word);
    ...

private:
    vector<node*> indexStructure;
    int lineCounter;
    int indexSize;

};

In my index.cpp class I have a method definition as the following:

node* index::newNode (string word)
{
    node* temp = new node();
    temp.item = word;
    temp.counter = 1;
    temp.pageNumber = new vector <int> (10, -1);
    temp.pageNumber[0] = lineCounter / 40;
    return temp;

}

when I compile, it tells me “node does not name a type” even though it is defined in the struct in index.h and my private vector variable can have the type node*.

  • 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-12T00:27:59+00:00Added an answer on June 12, 2026 at 12:27 am

    node is a nested class in index and thus it is called index::node within the global namespace.

    Note that you can omit the index:: from within the function body and thus only have to say index::node in the signature in your cpp file, since this is within “global namespace”.

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

Sidebar

Related Questions

I have the following code class MyJSONSerializableClass { [JsonProperty(index)] public int Index { get;
Let's assume we have the following Map index: public class CommentsIndex : AbstractIndexCreationTask<Post> {
I have the following Post entity: public class Post { public string Id {get;set;}
I have the following index created for RavenDB. public class DayOfMonths_AllDaysSortedByOrder : AbstractIndexCreationTask<DayOfMonth, DayOfMonth>
I have the following index action: class ExpensesController < ApplicationController def index() @expenses =
Given the following model, I want to index the fields (sequence,stock) class QuoteModel(models.Model): quotedate
I have the following string: index 0 1 2 3 4 5 6 7
I am getting the following errors: PHP Notice: Undefined index: Username class.form.php on line
Based on this article from Ayende i have created the following index definition public
Using following controller: class mydvbController extends Zend_Controller_Action { public function indexAction() { } public

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.