TCCI-Tririd Computer Coaching Institute is focused on providing Quality education with practical sessions.Satisfaction of our student is our priority. We pride ourselves for providing proficient IT solutions. We have a highly qualificated and expereinced faculties, who, not only handle teaching, but also aspire to provide the best possible solution through their technical expertise.
Showing posts with label C computer Coaching. Show all posts
Showing posts with label C computer Coaching. Show all posts
Wednesday, June 19, 2019
Tuesday, June 4, 2019
What is difference between function overloading and template? tccicomputercoaching.com
Both function overloading and templates are examples of polymorphism
.
Function overloading is used when multiple functions do similar operations; templates are used when multiple functions do identical operations.
Templates provide an advantage when you want to perform the same action on types that can be different.
Function Overloading works on different type’s no. of arguments.
Syntax:
1. template:
T sum(T a, T b)
{ T c;
c=a+b;
return c;
}
2. Function Overloading:
void sum(int a, int b)
{
ans =a+b;
}
void sum(int a , int b, int c)
{
ans=a+b+c;
}
To learn more concepts of Programming Languages at TCCI.
Visit us @ http://tccicomputercoaching.com/
Get Admission at TCCI.
Call us @ 9825618292
Function overloading is used when multiple functions do similar operations; templates are used when multiple functions do identical operations.
Templates provide an advantage when you want to perform the same action on types that can be different.
Function Overloading works on different type’s no. of arguments.
Syntax:
1. template:
T sum(T a, T b)
{ T c;
c=a+b;
return c;
}
2. Function Overloading:
void sum(int a, int b)
{
ans =a+b;
}
void sum(int a , int b, int c)
{
ans=a+b+c;
}
To learn more concepts of Programming Languages at TCCI.
Visit us @ http://tccicomputercoaching.com/
Get Admission at TCCI.
Call us @ 9825618292
Subscribe to:
Posts (Atom)
