// practice4-8.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> const int len = 70; struct pizza { char brand[len]; double diameter; double weight; }; int _tmain(int argc, _TCHAR* argv[]) { using namespace std; pizza * ps = new pizza; cout<<"Enter pizza brand:"; cin.getline(ps->brand,len); cout<<"Enter its diameter;"; cin>>(*ps).diameter; cout<<"Enter its weight:"; cin>>ps->weight; cout<<"****************************************"<<endl; cout<<ps->brand<<"\n"<<ps->diameter<<"\n"<<ps->weight<<endl; delete ps; system("pause"); return 0; }