Home Segments Index Top Previous Next

542: Practice

Suppose that you modify the short_name function appearing in the box_car class in the program shown in Segment 541 as follows:

virtual char* short_name ( ) { 
  char *character_pointer = "box"; 
  return character_pointer; 
} 

What happens? Explain your answer.