switch and visibility

Pages: 12
ah master I have any other questions 4 you...

1)why did you put virtual the thins inside class MyAppT? wasn't the same don't use virtual?

2) when you wrote
virtual Triangle * NewTriangle() {return 0;}

isn't the same to write

virtual Triangle * NewTriangle() = 0

or

virtual Triangle * NewTriangle() {};
(as you write in line 13)

or


virtual Triangle * NewTriangle() {;]

I'm a little confused whit this {,;}{{{}[cf[lgpdkhopf
(1) Using the virtual keyword in derived classes is not necessary.

(2) For the difference between the first two, look up abstract classes.
In line 13 I have a class, not a function. The last one is not syntactically correct.
sorry @all if I'm here again.. =(

here you are my new code http://www.megaupload.com/?d=2XP9OY6U

I have

AbsFigura -> AbsFiguraT -> Cerchio,Triangolo;Quadrato etc

but montecarlo funcion
template<class K> unsigned int montecarlo(unsigned int ,AbsFiguraT<K> & )
want an AbsFiguraT but I have only an AbsFigura!!!

Can't I downgarde from AbsFiguraT to AbsFigura? I need AbsFiguraT because into there there is a function that use Punto<T> so all the class must be templated...

Can't I use a template method inside a non-template class? (T was not declarde in this scope?)

How about something like this?

1
2
3
4
5
virtual void monte_carlo(unsigned int points, Shape * shape)
{
    ShapeT<T> * shapeT=dynamic_cast<ShapeT<T>*>(shape);
    //...
}
IT WORKS!!!

I had to use

AbsFiguraT<K> * tmp_fig = dynamic_cast<AbsFiguraT<K>*>(&figu);

YEAAAAAA HAHHAHHAHHA MUAHHAHHAHA

tanks a lot master...you're a big one.
Topic archived. No new replies allowed.
Pages: 12