TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sadaqat Jeelani
NA
20
15k
Help me to find error and correct the code
May 31 2016 1:25 PM
The class name is ‘audition’. Write a program with a function template named ‘get’ and another function template named ‘display’. The arguments for the function template should be, ‘anchor’, ‘artists’, ‘panel’. Your task is to activate the functionality of both the function templates defined above. The ‘get’ function should get the values for anchor, artists and panel from the user. And ‘display’ should display them.
Code
enter code here #include<iostream>
#include<string>
using namespace std;
template<class T>
class audition {
T Anchor, Artist, Panel;
public:
audition(T An, T Ar, T Pa) {
Anchor = An;
Artist = Ar;
Panel = Pa;
}
T GetValues();
T Display();
};
template<class T>
T audition<T>::GetValues() {
cout << "Enter Anchor :";
cin >> Anchor;
cout << "Enter Artist :";
cin >> Artist;
cout << "Enter Panel:";
cin >> Panel;
return 0;
}
template<class T>
T audition<T>::Display() {
cout << "Anchor :" << Anchor << endl;
cout << "Artist :" << Artist << endl;
cout << "Panel :" << Panel <<endl;
return 0;
}
int main() {
audition <string> myAudition("","","");
myAudition.GetValues();
myAudition.Display();
system("Pause");
}
Reply
Answers (
2
)
i cant find problem in my code
whats the problem in the running? rsa code