http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=1452 [º¹»ç]
#include <iostream>
using namespace std;
class BingSu
{
protected:
char bowl[20]; //´ã´Â ±×¸©À̸§
int howmany; //¸¸µå´Â °³¼ö
public:
BingSu()
{
cout << "¾óÀ½À» °¥¾Æ¼ ºù¼ö¸¦ ¸¸µé¾ú½À´Ï´Ù." << endl;
};
BingSu( char* _bowl )
{
BingSu();
strcpy( bowl, _bowl );
cout << "ºù¼ö¸¦" << bowl << "¿¡ ´ã½À´Ï´Ù." << endl;
};
BingSu ( char* bowl, int _howmany )
{
BingSu( bowl );
howmany = _howmany;
cout << "ºù¼ö¸¦" << howmany << "°³ ¸¸µì´Ï´Ù." <<endl;
};
};
int main()
{
BingSu aaa;
BingSu ( "¹ä±×¸©" );
BingSu ( "¹ä±×¸©", 3 );
return 0;
}
»ý¼ºÀÚ ³»¿¡¼ ´Ù¸¥ »ý¼ºÀÚ¸¦ ºÒ·¯¿À·Á°í Çߴµ¥ redefinition of formal parameter 'bowl' À̶ó´Â ÄÄÆÄÀÏ ¿¡·¯°¡ ³ª´õ¶ó±¸¿ä. bowl ÀÌ ¿Ö ÀçÁ¤ÀÇ ¿¡·¯°¡ ³ª´ÂÁö ¾î¶»°Ô ¼öÁ¤Çϸé ÁÁÀ»Áö ¾Ë·ÁÁÖ¼¼¿ä ¤Ð
|
Hit : 2432 Date : 2007/10/15 10:59
|