![]() |
|
#1
|
|||
|
|||
an array class templatethe question reads as follows :
write a program with class template Array. The template can instantiate an Array of any elelment type. Override the template with a specific defenition for an Array of float elements (class Array<float>). i have created the following : CPP / C++ / C Code:
now how do i do that overriding thing? i'm lost on that. can anyone help plz? |
|
#2
|
||||
|
||||
|
Sorry for the late reply...
You can create a specialisation of your template class. It is not supported by *old* compilers. I've created a new member function, Test, so you can test it yourself. I guess I express myself better in code CPP / C++ / C Code:
Test it: CPP / C++ / C Code:
If any questions, fell free to ask. Best regards, Lucian __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
Recent GIDBlog
Developing GUIs with wxPython (Part 4) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| beginner::friend template class | if13121 | C++ Forum | 1 | 04-Mar-2005 05:56 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 21:26 |
| Error C2146: syntax error : missing ',' before identifier 'C4' | mattchew008 | C++ Forum | 2 | 19-Dec-2004 06:06 |
| hashing help | saiz66 | C++ Forum | 1 | 06-Jul-2004 06:16 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The