









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main topics in this course are object-orientation, objects and classes, overloading, inheritance, polymorphism, generic programming, exception handling, introduction to design patterns. This lecture includes: Resolution, Order, Object, Orient, Program, Compiler, Specialization, Template, Void, Sort, Vector, Char, Overload
Typology: Slides
1 / 17
This page cannot be seen from the preview
Don't miss anything!










►
►
int main() { int main() {
char* str = char* str = ““Hello World!Hello World!””;;
sort(str); // sort( char* )
sort(str); // sort( char* )
Vector<char*> v1 = {
Vector<char*> v1 = { “
ab
ab ”
cd
cd ”
sort(v1); //sort( Vector<char> & ) sort(v1); //sort( Vector<char> & )
►
►
►
►
int main() { int main() {
A< int > obj1; A< int > obj1;
B< int* > obj2;
B< int* > obj2;
return 0;
return 0;
template< class T > template< class T >
class A
class A
template< class T > template< class T >
class A< T* >
class A< T* >
docsity.com
template< > template< >
class B< int* > : public A< T* >
class B< int* > : public A< T* >
{ { …… }} // Error: Undefined// Error: Undefined ‘‘TT’’
class B : public A< T* > class B : public A< T* >
// Error
// Error : Undefined
: Undefined ‘
template< class T >
template< class T >
class B : public A< float* > class B : public A< float* >
int main() {
int main() {
A< float* > obj1;
A< float* > obj1;
B< int > obj2; B< int > obj2;
return 0; return 0;
int main() { int main() {
A< float* > obj1; A< float* > obj1;
B< double* > obj2;
B< double* > obj2;
return 0;
return 0;
int main() { int main() {
A< float* > obj1; A< float* > obj1;
B obj2;
B obj2;
return 0;
return 0;
int main() { int main() {
A obj1; A obj1;
B< int* > obj2;
B< int* > obj2;
return 0;
return 0;
int main() { int main() {
A obj1; A obj1;
B< char* > obj2;
B< char* > obj2;
return 0;
return 0;