![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Microsoft Visual C++6.0 - Illegal use of this type as an expressionHey everyone, I am new here, but this is driving me nuts. Heh. I am doing this project for my Computer Science class, and am trying to complie this in Microsoft Visual C++ 6.0, but get the following error:
d:\compsci2\project5binarytree\driver.cpp(65) : error C2275: 'WordBST' : illegal use of this type as an expression d:\compsci2\project5binarytree\driver.cpp(44) : see declaration of 'WordBST' Error executing cl.exe. Here is the code for my driver file, and I've marked the line thats giving the error with a comment, at the very bottom of the code. (Line that starts - BST<Word>*getWord ). Thanks in advance. CPP / C++ / C Code:
|
|
#2
|
|||
|
|||
|
Ah, my friend got it, nevermind then. Ah well...
|
|
#3
|
||||
|
||||
|
Hello RealmMaster,
I am sorry no one could get to your issue in time, but I appreciate that you came back to say that you found the solution. Since this thread may start appearing in the Search Engine results for a similar phrase search, could you possibly post the solution so readers will find some value in the information you provide here? __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#4
|
|||
|
|||
|
Hey, it's okay. Sorry for the long reply as well.
Here is what we changed: CPP / C++ / C Code:
Hopefully anyone else with this problem this will help |
|
#5
|
|||
|
|||
Re: Microsft Visual C++6.0 - Illegal use of this type as an expressionMissed three hours of productive work because one character.
I had code like this: CPP / C++ / C Code:
So the '{' character in wrong place gave me an error C2275: 'some typedef' : illegal use of this type as an expression. The error was much further down the code than the actual cause of error and I was puzzled. Well finally I found the reason of this very odd error message. Hope this helps someone and saves valuable time and nerves. Last edited by admin : 07-Apr-2006 at 01:01.
Reason: Please insert your C code between [c] & [/c] tags
|
|
#6
|
|||
|
|||
Re: Microsoft Visual C++6.0 - Illegal use of this type as an expressionOr if you're like me you may have said
XalanDOMString str = testFunction(XalanDOMString) notice the use of XalanDOMString (the type) in place of the parameter. My bad :-) |
Recent GIDBlog
Meeting the populace by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The