|
-
April 15th, 2008, 12:14 AM
#1
function template
im working on a function template. i just want to know if im doing it right so far. i put comments on parts im not sure of
#include<iostream>
using namespace std;
template <typename isEqualTo = int> // is this a template header with one formal type of parameter
// how would i write a header for function template isEqualTo
{
return arg1==arg2;
}
int main(){
int a;
int b;
cout<<"enter two interger values: ";
cin>>a>>b;
cout<<a<<"and"<<b<<"are"
<<( ?"equal":"not equal")<<'\n';
return 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|