![]() |
|
#1
|
|||
|
|||
Template usage - global functionsHow can I solve the errors?
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Error: Code:
Last edited by LuciWiz : 18-Dec-2006 at 14:07.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: template usage - global functionsQuote:
CPP / C++ / C Code:
Quote:
CPP / C++ / C Code:
The next four errors should be solved once you fix the error on line 107 and the compiler acknowledges the existence of the function getTopPtr. CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: template usage - global functionsthank you ubergerek. your helps worked a lot
CPP / C++ / C Code:
error: Code:
by the way I want to ask some other question: If I want to reach the topPtr in Stack.h ( which is private member ) not by function getTopPtr() but declaring AlgebraicExpression class as a friend function. But AlgebraicExpression is global. where can I define the friendship of these classes? thanks a lot Last edited by LuciWiz : 19-Dec-2006 at 16:07.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#4
|
|||
|
|||
Re: template usage - global functionsThe problem is getTopPtr is declared as returning a StackNode; change it to a StackNode*. In the class Stack you can put (instead of friend class -- there is no class AlgebraicExpression, just a file named that) "friend ..." and then the signature (prototype) of the function infix2postfix. I think that should answer your question.
|
Recent GIDBlog
Not selected for officer school by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Fatal error C1083: Cannot open include file | mia | C++ Forum | 5 | 14-May-2007 15:35 |
| error template with C linkage | MichaelS-R | C++ Forum | 6 | 17-May-2006 11:09 |
| Testing a template class | earachefl | C++ Forum | 7 | 13-May-2006 17:21 |
| Combining Vectors and References | Frankg | C++ Forum | 7 | 14-Jan-2006 06:17 |
| conflict between printf and stdarg.h va functions | mirizar | C Programming Language | 3 | 12-Jul-2004 08:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The