//This program doesn't allow me to give all input
using namespace std;
food *pizza = new food;
cout<<"\nEnter detail: ";
cout<<endl<<pizza->name<<" has weight "<<pizza->weight<<" and diameter "<<pizza->diameter;
Do not mix stream operators and getline.
If you absolutely need to use getline — use cin.ignore() before that.