C¿Í C++°ü·Ã |
---|
Á¦¸ñ | c++ÀÔ´Ï´Ù. 1998/07/02 (12:40) |
À̸§ | ¾çº´¿ì |
¹øÈ£ | 3 |
Á¶È¸ | 688 |
º»¹® |
ÀüȹøÈ£¸¦ ¸¸µé¾î¾ß ÇѴµ¥... ÀÌ°Ô ±× Ç¥º»Àε¥ ¿ÏÀüÇÏÁö ¾Ê½À´Ï´Ù. #include<iostream> #include<string> struct{ string name; int number; Item*next; Item() :next(NULL){} ---->ÀÌ°Ô ´ëü ¹» ¶æÇϴ°ÇÁö... }; class List{ Item*head; public: List():head(NULL){} ------->ÀÌ°Ç ¶Ç ¹» ¸»ÇÏ´Â °ÇÁö... ~List(); ---------------->ÀÌ°Ç ¿Ö ±»ÀÌ ¾²´Â °ÇÁö... bool AddItem(Item*ptr); void PrintList(); }; List::~List(){ -------------->¿©±â¼´Â destructor Á¤ÀǸ¦ ³»·Á¾ß Çϴµ¥ ¾î¶»°Ô Ç϶ó´Â °ÇÁö. } bool List::AddItem(Item*ptr){ -------------->¿©±â´Â Á¤·ÄÀ» ÇÏ´Â °Ì´Ï±î? ---->¿©±â¼ boolÀº ¿Ö ¾²¿´½À´Ï±î? } void List::PrintList(){ } main(){ List phonenumber; for(int i=0;i<10;i++){ Item*p= new Item(); .... ÀÌ°Å ´ÙÀ½ÁÖ ¿ù¿äÀÏ ±îÁö ³»¾ßÇÕ´Ï´Ù... »¡¸® ´äÇØ ÁÖ¼ÌÀ¸¸é °¨»çÇÏ°Ú½À´Ï´Ù. |