LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2005, 09:42 PM   #1
Palamides
Member
 
Registered: Jan 2005
Posts: 104

Rep: Reputation: 15
need help with c++ heaps


I am writing a head data structure for a school project, I am getting the following error when trying to compile my head header file of my heap's template:


Code:
In file included from topk.cpp:6:
CHeap.h:25: error: using template type parameter `TYPE' after `class'
CHeap.h:25: error: ISO C++ forbids declaration of `type name' with no type
CHeap.h:25: error: `CHeap<TYPE>' specified as declarator-id
CHeap.h:25: error: no `int CHeap<int>::CHeap<TYPE>(int)' member function
   declared in class `CHeap<int>'
CHeap.h:25: error: template definition of non-template `int
   CHeap<int>::CHeap<TYPE>(int)'
This is line 25:

Code:
template<class TYPE>
CHeap<class TYPE>::Cheap<TYPE>(int size) {
This is line 9 to 14:

Code:
template<class TYPE>
class Cheap() {

public:

CHeap<TYPE>(int size);

anyone know what that error means? thanks

Last edited by Palamides; 04-02-2005 at 09:49 PM.
 
Old 04-02-2005, 09:58 PM   #2
Palamides
Member
 
Registered: Jan 2005
Posts: 104

Original Poster
Rep: Reputation: 15
nm i fixed it, jsut in case someone need this in the future ill post the solution:

l.25 needs to be

template<class TYPE>
CHeap<TYPE>::Cheap(int size) {
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Private Heaps? (similiar to HeapCreate on Win) aboteler Programming 2 04-11-2005 12:59 PM
Sendmail: I need a little help setting up users, thanks heaps in advance! scorpatron Linux - Software 3 11-25-2003 09:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration