Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include"testClass.h"
- using namespace std;
- template < class T >
- testClass::getA ( void ){
- cin >> a;
- }
- testClass::getB ( void ){
- cin >> b;
- }
- testClass::setAns ( void ){
- ans = a + b;
- }
- testClass::printAns ( void ){
- cout << ans << endl;
- }
- int main(){
- testClass data;
- data.getA();
- data.getB();
- data.setAns();
- data.printAns();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement