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
	void DSInitilize(void);

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

	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?


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, learning, and sharing knowledge.