c++ 구조체 구현
- 등록일 / 수정일
- 페이지 / 형식
- 자료평가
- 구매가격
- 2012.04.26 / 2019.12.24
- 7페이지 / hwp (아래아한글2002)
- 평가한 분이 없습니다. (구매금액의 3%지급)
- 500원
최대 20페이지까지 미리보기 서비스를 제공합니다.
자료평가하면 구매금액의 3%지급!
1
2
3
4
5
6
7
추천 연관자료
- 목차
-
■개요
■소스코드
■실행결과
■개요
■소스코드
■실행결과
- 본문내용
-
■소스코드
#include <iostream>
#include <cstring>
using namespace std;
struct Date
{
private:
int year;
char month[10];
int day;
public:
int GetYear();
char* GetMonth();
int GetDay();
void ShowDate();
void SetDate(int a, char* b, int c);
};
int Date::GetYear()
{
return year;
}
char* Date::GetMonth()
{
return month;
}
int Date::GetDay()
{
return day;
}
void Date::ShowDate()
{
cout<<"날짜: "<<year<<"년 "<<month<<"월 "<<day<<"일"<<endl;
}
void Date::SetDate(int a,char* b,int c)
{
year=a;
strcpy(month,b);
day=c;
자료평가
-
아직 평가한 내용이 없습니다.