M
mthread
Hi,
I get the compilation error,
main.cpp : In member function 'int
SingleQueue<Type>::Show_qelements()':
main.cpp:25: error: expected `;' before 'pos'
when I compile the code given below. Kinldy let me know what is
the change I need to do.
#include <iostream>
#include <list>
using namespace std;
template <class Type>
class SingleQueue
{
private :
pthread_mutex_t a_mutex;
pthread_cond_t a_cond;
char a_isAvlbl;
list<Type> a_ll;
public :
int Show_qelements();
};
template <class Type>
int SingleQueue<Type>::Show_qelements()
{
list<Type>::iterator pos; //Compilation error occurs here
return 1;
}
struct Message
{
int no;
};
int main()
{
SingleQueue<Message*> queue;
queue.Show_qelements();
return 1;
}
I get the compilation error,
main.cpp : In member function 'int
SingleQueue<Type>::Show_qelements()':
main.cpp:25: error: expected `;' before 'pos'
when I compile the code given below. Kinldy let me know what is
the change I need to do.
#include <iostream>
#include <list>
using namespace std;
template <class Type>
class SingleQueue
{
private :
pthread_mutex_t a_mutex;
pthread_cond_t a_cond;
char a_isAvlbl;
list<Type> a_ll;
public :
int Show_qelements();
};
template <class Type>
int SingleQueue<Type>::Show_qelements()
{
list<Type>::iterator pos; //Compilation error occurs here
return 1;
}
struct Message
{
int no;
};
int main()
{
SingleQueue<Message*> queue;
queue.Show_qelements();
return 1;
}