Jump to content
  • Advertisement
Sign in to follow this  
CoB_ChrizZz

Abstract Classes / Dynamic Binding Problem

This topic is 2523 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello !

Since the exams for this semester are coming near i am preparing for some tests now..in this case a C++ one.
here i am troubling with some virtual/abstract classdesign stuff i need to understand for the test.
the following code contains some classes to describe an Expression.

http://pastebin.com/Y7kUde0X

(+ 5 3) or (* 6 4) [lisp syntax] are working now !
But i also need doing stuff like (* 5 (+ 3 8)) as you can see in my last "useful" line
of code in the main function.
But instead i get the error: "Expression must have (pointing - to) function type"

And i just can't find out what's wrong with my code :/
Can anybody see it ?

Share this post


Link to post
Share on other sites
Advertisement


  1. Ausdruck* Ausdruck_mal = new Mal(opc, opd);

  2. Plus Ausdruck_plus_mal(opa, Ausdruck_mal( opc, opd)); //Console Output should be: (+ 5 (* 3

You create a variable and then use it as if it is a function. I assume that is the broken line.

Share this post


Link to post
Share on other sites
oh wow...it was really late last night...and when i woke up i still thought everything was allright...just now i had to giggle about my mistake ^^
thank you dpadam450 !

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!