Home Segments Index Top Previous Next

424: Practice

What will happen if you run the following program? Why?

#include  
const double pi = 3.14159; 
class cylinder { 
  public: 
    double radius, length; 
    double volume ( ) {return pi * radius * radius * length;} 
}; 
main ( ) { 
  cylinder *cptr; 
  while (1) cptr = new cylinder; 
}