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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:49:13+00:00 2026-06-15T02:49:13+00:00

sample code: file: LinkedStack.h #include NodeType.h #ifndef LINKEDSTACK_H #define LINKEDSTACK_H template <class ItemType> class

  • 0

sample code:

file: LinkedStack.h

#include "NodeType.h"

#ifndef LINKEDSTACK_H
#define LINKEDSTACK_H

template <class ItemType>
class LinkedStack {
public:
    NodeType topPtr;
};

file: NodeType.h

#ifndef NODETYPE_H
#define NODETYPE_H

template <class ItemType>
class NodeType {
public:

    ItemType info;
    NodeType *nextElement;

};

#endif  /* NODETYPE_H */

file: main.cpp

#include "NodeType.h"
#include "LinkedStack.h"

using namespace std;

int main(int argc, char** argv) {

    return 0;
}

When I run this, I keep getting:

LinkedStack.h:20: error: `NodeType’ does not name a type

However NodeType is already defined and included?

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

    NodeType is a template. Change to:

    NodeType<ItemType> topPtr;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a code sample: // file main.cpp #include <iostream> #include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple_io.hpp>
I've got a source code file that started as a copy of some sample
I have developed sample api as jar file. This jar file contains the code
This is a simple code that open and print the file content. #include <stdio.h>
This is a sample code for memory mapped file share. The mapped_region is d
I have sample code written for parsing xml file using javax.xml package. it uses
Does anyone have some sample code demonstrating how to make a file browser view?
here is a sample code. If I remove the stdafx.h file, the program wont
Can we move default file to another filegroup. sample code is given below Sample
Code sample: for file in files: do_something(root+file) I want to replace file with f

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.