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;
}
//----------------------------------------------------------------------------------------
'◆ 무한한 가능성 > & Visual C/C++' 카테고리의 다른 글
[C/C++] cout.setf() (0) | 2009.03.16 |
---|---|
[C/C++] 문자열합치기 srcat(A, B); (0) | 2009.03.16 |
[C/C++] C++기초플러스> 4장 프로그래밍 연습 09 (0) | 2009.03.16 |
[C/C++] 포인터와 배열의 표현기법 - *p, p[0] (0) | 2009.03.13 |
[C/C++] cout 에서의 (int *) (0) | 2009.03.13 |