tags:

views:

100

answers:

1

I have a function

queue< pair<int,int> > * factorize(int n) {
...}

It shows this compile error.

generatePrimes.cpp:20: error: expected constructor, destructor, or type conversion before '<' token
generatePrimes.cpp:20: error: expected `,' or `;' before '<' token

What's wrong?

+4  A: 

Either you don't include necessary header files (queue and utility), or don't have using namespace std or both.

To overcome the first problem include the headers. To overcome the second one either add using or provide fully qualified names (std::queue and std::pair).

sharptooth
Thanx, I didnt write namespace.
avd