Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Tagged as

dynamic array of interfaces

, 21 Sep 2012 CPOL
If you are using polymorphism then you have to use a pointer or reference, you can not achieve polymorphism with values. In this case:MyInterface *a;a = new MyClass[n];for (int i=0; i<n; i++) { a[i].myFunction ();}Your MyInterface *a "array" stores the the class instances...

Revisions


  

Compare Revision Minor Date Status Editor
publicly available No 21-Sep-12 14:39 Available pasztorpisti
Updates in content. 5 changes had been made.
4 No 21-Sep-12 14:09 Available pasztorpisti
Updates in content. 5 changes had been made.
3 No 21-Sep-12 13:54 Available pasztorpisti
Updates in content.
2 No 21-Sep-12 13:25 Available pasztorpisti
Updates in content. 1702 changes had been made.
1 No 21-Sep-12 10:08 Available pasztorpisti

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

pasztorpisti
Software Developer (Senior) CRYTEK
Hungary Hungary
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 21 Sep 2012
Article Copyright 2012 by pasztorpisti
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid