Sign in to follow this  
Amaz1ng

Ugh...always stupid errors

Recommended Posts

I'm sitting around doing project Euler problems, and I'm constructing a solution to one of the problems but I'm getting an error from this here (nowhere near finished yet):

[code]
#include <iostream>
#include <conio.h>
#include <queue>

template<class T>
class Queue : public queue<T>
{
public:
T dequeue()
{
T tmp = front(); //storing the current front of the queue for return
queue<T>::pop(); //now remove it
return tmp;
}

void enqueue(const T& element)
{
queue<T>::push(element); // add element to queue
}
};

template<class T>
class BTNode
{
private:
BTNode * left, *right;
T element;
public:
BTNode()
{
left = right = 0;
}

BTNode(T &el, BTNode * l, BTNode * r)
{
left = l;
right = r;
element = el;
}

~BTNode()
{
delete left;
delete right;
}

};

void main()
{
getch();
}
[/code]

It says: error C2143: syntax error : missing ',' before '<' Line 6

Can someone point it out because I'm not seeing it...haha


[b]-edit- OK apparently it was some kind of bug...I got it to work now. [/b]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this