◆ 무한한 가능성/& Visual C/C++

[C/C++] C++기초플러스> 4장 프로그래밍 연습 08

치로로 2009. 3. 16. 11:31

C++기초플러스> 4장 프로그래밍 연습 08




pizza *p = new pizza;
typeName *pointer_name = new typeName[];




//----------------------------------------------------------------------------------------
//Source>
//----------------------------------------------------------------------------------------

#include <iostream>
#include <string>

using namespace std;

struct pizza
{
 string company;
 float diameter;
 float weight;
};

void main()
{
 pizza *p = new pizza;
 
 cout << "Input diameter: ";
 cin >> p->diameter;
 cout << "Input company: ";
 cin >> p->company;
 cout << "Input weight: ";
 cin >> p->weight;
 
 cout << endl;

 cout << p->diameter << endl;
 cout << p->company << endl;
 cout << p->weight << endl;
}


//----------------------------------------------------------------------------------------