Hai,
        I'm trying to use pointer, array and struct together. I'm a newbie.
Here is my code. I still don't know what's wrong with it. So guys plz help 
me out.

#include <iostream>
using namespace std;
#include <conio.h>

const int nameSize = 20;
struct pizza
{
     char name[nameSize];
     float diameter;
     float weight;
};

int main()
{
     cout << "Welcome to William Wingate Pizza Analysis Service!\n";
     cout << "How many pizza do you want to make?\n";

     /////////////////
     int quantity;
     (cin >> quantity).get();
     pizza * guest=new pizza[quantity];
     /////////////////

     ///////////////////////////////////////////////////////////
     for (int i=1; i<=quantity; i++)
     {
         cout << "Enter number " << i << " pizza statistics!\n";
         cout << "Enter pizza name     : ";
         cin.getline(guest[i]->name,nameSize);
         cout << "Enter pizza diameter : ";
         cin >> guest[i]->diameter;
         cout << "Enter pizza weight   : ";
         (cin >> guest[i]->weight).get();
     }
     ///////////////////////////////////////////////////////////
     cout << "\nHere is your pizza statistics!\n";
     ///////////////////////////////////////////////////////////
     for (int i=1; i<=quantity; i++)
     {
         cout << "Pizza number " << i << endl;
         cout << "Name     : " << guest[i]->name << endl;
         cout << "Diameter : " << guest[i]->diameter << endl;
         cout << "Weight   : " << guest[i]->weight << endl;
     }
     ///////////////////////////////////////////////////////////
     getch();
     return 0;
}

Thank you and Happy New Year







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~-> 

To unsubscribe : [EMAIL PROTECTED]

 
Yahoo! Groups Links

<*> To reply to this message, go to:
    
http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4981
    Please do not reply to this message via email. More information here:
    http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> To visit your group on the web, go to:  
    http://groups.yahoo.com/group/Programmers-Town/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to