Demostración de cómo desenrollar una pila.
c:
#include <iostream>
using std::cout;
using std::endl;
#include <stdexcept>
using std::runtime_error;
void funcion3() throw ( runtime_error )
{
throw runtime_error( "runtime_error en funcion3" );
} // fin de la función function3
void funcion2() throw ( runtime_error )
{
funcion3();
} // fin de la función function2
void funcion1() throw ( runtime_error )
{
funcion2();
} // fin de la función function1
int main()
{
try {
funcion1();
} // fin de try
catch ( runtime_error e )
{
cout << "Ocurrio un excepcion: " << e.what() << endl;
} // fin de catch
return 0;
} // fin de la función main
using std::cout;
using std::endl;
#include <stdexcept>
using std::runtime_error;
void funcion3() throw ( runtime_error )
{
throw runtime_error( "runtime_error en funcion3" );
} // fin de la función function3
void funcion2() throw ( runtime_error )
{
funcion3();
} // fin de la función function2
void funcion1() throw ( runtime_error )
{
funcion2();
} // fin de la función function1
int main()
{
try {
funcion1();
} // fin de try
catch ( runtime_error e )
{
cout << "Ocurrio un excepcion: " << e.what() << endl;
} // fin de catch
return 0;
} // fin de la función main
December 27th, 2007 at 1:22 am
Noto algo, esto es C++
y parece mas divertido 

Tenes dire de algun manual en el cual pueda aprender
eso de cout tengo entendido que hace lo mismo que el printf
y el endl indica fin de linea ?
que hace el e.waht ?:P
algo asi como el cin ??
Saludos.
January 20th, 2008 at 2:23 pm
Realmente no recuerdo la diferencia pero aquí hablan al respecto: http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.1