<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Que tal maestros de C con Clase... nuevamente vuelvo con mis dudas, que seguro que alguno ya las echaba de menos <img src="http://gfx2.hotmail.com/mail/w3/ltr/emoticons/smile_teeth.gif" alt="" width="19" height="19"><br><br>Resulta que para averiguar el tipo de una clase, se me ha "ocurrío" sobrecargar un método y de momento todo Ok...<br><br><font style="" color="#c0504d" face="Courier New">class</font><font style="" face="Courier New"> Pura</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">{</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">...</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">    </font><font style="" color="#c0504d" face="Courier New">virtual</font><font style="" face="Courier New"> ~Pura()=0;</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">...</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">};</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"><br></font><font style="" color="#c0504d" face="Courier New">class</font><font style="" face="Courier New"> HijaDePura : </font><font style="" color="#c0504d" face="Courier New">public</font><font style="" face="Courier New"> Pura</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">{</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">...</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">};</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"><br></font><font style="" color="#c0504d" face="Courier New">class</font><font style="" face="Courier New"> HijoDePura : </font><font style="" color="#c0504d" face="Courier New">public</font><font style="" face="Courier New"> Pura</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">{</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">...</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">};</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"><br></font><font style="" color="#c0504d" face="Courier New">void</font><font style="" face="Courier New"> QuienEsQuien(HijoDePura&);</font><font style="" face="Courier New"><br></font><font style="" face="Courier New"><br></font><font style="" color="#c0504d" face="Courier New">void</font><font style="" face="Courier New"> QuienEsQuien(HijaDePura&);</font><br>
<br>Hasta aquí todo Ok, pero el problema es cuando lo anido, tomando la clase base...<font style="" face="Courier New"><br></font><font style="" color="#c0504d" face="Courier New"><br>void</font><font style="" face="Courier New"> Quien(Pura& clase)</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">{</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">   QuienEsQuien(clase); </font><font style="" color="#92d050" face="Courier New">// ERROR!!!</font><font style="" face="Courier New"> </font><font style="" color="#92d050" face="Courier New">toma "clase" cómo si fuera "Pura"</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">...</font><font style="" face="Courier New"><br></font><font style="" face="Courier New">}</font> <br><br>Por qué no surte los efectos deseados, <u>siendo "clase" un derivado de Pura</u>? Gracias anticipadas y resaludos...<br>Pedro<br><br /><hr />Discover the new Windows Vista <a href='http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE' target='_new'>Learn more!</a></body>
</html>