error while creating an object

I'm trying to write a c++ program to implement queue in ubuntu os using codelite IDE, I still didn't complete the program but I am getting an error when I checked if the code I wrote was correct or not

error: missing template arguments before ‘ob’
error: expected ‘;’ before ‘ob’


The code is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include<iostream>
#include<math.h>
#include<stdlib.h>
#define size 10
using namespace std;
template<class t>
class que{
public:
	int count;
	t q[size];
	que(){
		char c,o;
		cout<<"Queue is created\n(you can choose other options after creating the queue)\nDo you want to enter any elements?[y/n] :";
		cin>>c;
		if(c=='y'||'Y'){
			t x;
			do{
			cout<<"Enter the element :";
			cin>>x;
			q[count]=x;
			count++;
			cout<<"Do you want to continue?[y/n] :";
			cin>>o;
			}while(o=='y'||'Y');
		}
		}
		
		int length();
		t get(int);
		int search(t);
		void enter(t);
		void leave();
		void show();
};

template<class t>int que<t>::length(){
	return count;
}

template<class t>t que<t>::get(int i){
	return q[i];
}

template<class t>void que<t>::enter(t a){
	q[count]=a;
}

template<class t>void que<t>::leave(){
	for(int i=0;i<count-1;i++)
		q[i]=q[i+1];
	count--;
}

template<class t>void que<t>::show(){
	for(int i=0;i<count;i++)
		cout<<q[i]<<endl;
}

template<class t>int que<t>::search(t z){
	int n=0,p[10],r;
	for(int i=0;i<count;i++){
		if(q[i]=z){
			p[n]=i;
			n++;
		}
	}
	r=n;
	for(int i=0;i<n;i++)
		r=r+p[i]*pow(10,i+1);
	return r;
}

main(){
	que ob;
	int m;
	cout<<"1.Size of queue\n2.Display the queue\n3.To enter an element\n4.Remove an element\n5.To get an element of queue\n6.To search for an element in queue\n7.Exit"<<endl;
	cout<<"Choose an option :";
	switch(m){
		default: cout<<"There is no option "<<m<<"."<<endl;
		case 1:break;
		case 2:break;
		case 3:break;
		case 4:break;
		case 5:break;
		case 6:break;
		case 7:exit(0);
	}
}





Can anyone please help me?
main must have return type int.

You forgot to specify the template argument on line 74.
I'm actually new to c++, can I know what is a template argument and how to specify it, please?
Thanks for helping I just have to specify if the type of template for example:

que<int> ob;

or

que<float> ob;

or

que<char> ob;
Topic archived. No new replies allowed.