#include <iostream.h>
class A {
int no;
char ch;
public:
A();
A(int n);
A(int n, char c);
A(char c);
};
A::A()
{
cout << "Default Constructor\n";
}
A::A(int n)
{
no = n;
cout << "int Count~\n";
}
A::A(int n, char c)
{
no=n, ch=c;
cout << "int char count\n";
}
A::A(char c)
{
ch=c;
cout << "Char Constructor\n";
}
void main(void)
{
// A aa;
//A bb(5);
//A cc(5, 'a');
//A dd('B');
cout << "----------------" << endl;
//A *p;
//p = new A[3];
//A aa[3] = { A(5), A(5,3), A('A') };
A *p[] = { new A, new A(5), new A(5,'a'), new A[2], };
delete p[0];
delete p[1];
delete p[2];
delete [] p[3];
// delete p;
}
요런 방법도..
new A[2] 다음에 , 는 중요함.
피드 구독하기:
댓글 (Atom)
UPBIT is a South Korean company, and people died of suicide cause of coin investment.
UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...
-
□ native modifier 는 자바가 아닌 다른 언어로 작성된 코드를 자바에서 사용하기 위한 것 □ transient modifier 는 객체가 직렬 화되는 과정에서 해당 필드가 저장되지 않아야 한다는 것을 알리기 위해 사용 ...
-
연휴 마지막날 아침... 산책을 하다 한장 찍어보았다. 인생도 마찬가지로 길의 끝을 모른체 선택을 해야하는 경우가 발생한다. 나중에 그 기준이 바뀔수도 있지만. 지금 기준은 많은 사람이 함께 갈 수 있는 길을 선택하고 싶다.
-
#오픈그록을 외부페이지로 설정하기 위해 먼저 톰캣을 설치하여 보자 1. 톰캣? - 아파치 소프트웨어 재단에서 개발된 서블릿 컨테이너만 있는 웹 애플리케이션 서버. 톰캣은 웹서버와 연동하여 실행할 수 있는 자바환경을 제공하여 자바 서버 페...
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.