umm veo un par de cosas raras en ese codigo, lo primero que haces dos new y ademas el segundo new(pC), para que se pone el (pC)? es que nunca lo he usado.<br><br>otra cosa pon depues de bucle for que hace el cout otro cout con endl al final (lo del el endl es para que no se quede el cout en la pila, que lo envie a pantalla) que te indique si el fallo esta justo al terminar el bucle o en el delete<br>
<br><div class="gmail_quote">El 28 de mayo de 2009 13:08, kalith kalith <span dir="ltr"><<a href="mailto:kalith.9@gmail.com">kalith.9@gmail.com</a>></span> escribió:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
si es que el error con delete me lo da cuando uso new osea hize esta prueba para ver como pifaba.<br><br>

<p style="margin: 0px; text-indent: 0px;">#include <iostream></p>
<p style="margin: 0px; text-indent: 0px;">#include <new></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">using namespace std;</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">int main(void)</p>
<p style="margin: 0px; text-indent: 0px;">{</p>
<p style="margin: 0px; text-indent: 0px;">      int n, i = 0;</p>
<p style="margin: 0px; text-indent: 0px;">      char *pC = NULL;</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">      cout << "Ingrese: ";</p>
<p style="margin: 0px; text-indent: 0px;">      cin >> n;</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">      pC = new char[n];</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">      for(; i < n;)</p>
<p style="margin: 0px; text-indent: 0px;">              pC[i++] = 'a';</p>
<p style="margin: 0px; text-indent: 0px;">      </p>
<p style="margin: 0px; text-indent: 0px;">      pC = new(pC) char[n+1];</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">      pC[i] = 'b';</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">      </p>
<p style="margin: 0px; text-indent: 0px;">      for(int j = 0; j < n+1; j++)</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">              cout << *pC++ << endl;</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">        delete [] pC;<br></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">}</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">muestra las letras todo perfecto pero el error es al liberar la memoria.<br></p><div>
<div></div><div class="h5"><br>
<br clear="all"><br>-- <br>Seamos realistas y hagamos lo imposible<br>Linux Counter User #487374<br><br>---<br>Nosotros los complacientes, guiados por lo desconocido, estamos haciendo lo imposible para los ingratos, y hemos estado haciendo tanto por tanto tiempo con tan poco, que ahora estamos capacitados a hacer cualquier cosa con nada<br>


</div></div><br>_______________________________________________<br>
Lista de correo Cconclase <a href="mailto:Cconclase@listas.conclase.net">Cconclase@listas.conclase.net</a><br>
<a href="http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net" target="_blank">http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net</a><br>
Bajas: <a href="http://listas.conclase.net/index.php?gid=2&mnu=FAQ" target="_blank">http://listas.conclase.net/index.php?gid=2&mnu=FAQ</a><br></blockquote></div><br>