I am attempting to use a queue. I am doing it just like an example i read. I am doing a vs2005 form applicaiton.

#pragma once
#include <queue>

public ref class DataSource
{
public:
	DataSource(void);
	
	void DSInitilize(void);

	char*				   getNextElement(void);
	System::Void		   setNextElement(char* value);

private:
	queue<char>			   MessageQueue;
};

It is not finding the data type of the queue<char> messageQueue declaration.

here are the errors:

error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2238: unexpected token(s) preceding ';'

I am going to fill each element with char*. I dont know why I am getting this error. Any advice?

Thanks.

All STL classes are declared in namespace std. Open namespaces with using namespace std; or use fully qualified name as std::queue .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.