Hi everyone! I finished up my C programming book back in December, then took a break. I'm back and studying C++ now, and this is my first question.

I completed the exercise successfully, in terms of using "new" for a structure pointer, and all data displayed as it should after user input. What I'm wondering is, just for my own edification, I placed identical display code after I used "delete" to free the memory, and while the string member seems to be emptied out, both of the float members still retain the input data. Is this okay, or am I not using the delete keyword properly with a structure?

Thanks!

Code:
// Do programming exercise 4, but use new to allocate a structure
// instead of declaring a structure variable. Also, have the program
// request the pizza diameter before it requests the pizza company name.

#include <iostream>
using namespace std;

struct Pizza
{
   char company[30];
   float diameter;
   float weight;
};

int main()
{
   const int arraysize = 30;

   Pizza * pie = new Pizza;

   cout << "\nWhat is the diameter of your pizza in inches? _\b";
   cin >> pie->diameter;
   cin.get();

   cout << "\nWhat restaurant did your pizza come from? _\b";
   cin.getline(pie->company, arraysize);

   cout << "\nWhat is the weight of your pizza in ounces? _\b";
   cin >> pie->weight;

   cout << "\nYour pizza came from " << pie->company << ", it's "
      << pie->diameter << " inches in diameter, and\n"
      << "it weighs " << pie->weight << " ounces." << endl;

   delete pie;

   cout << "\nAfter freeing up used memory:\n";
   cout << "\nYour pizza came from " << pie->company << ", it's "
      << pie->diameter << " inches in diameter, and\n"
      << "it weighs " << pie->weight << " ounces." << endl;

   return 0;
}