13
C++ 프로그래밍 실습 4주차

C++ 프로그래밍실습sclab.konkuk.ac.kr/attachments/lecture/3/C++Exercise04.pdf · 2019-10-10 · Practice04 •Constructor를통해string_content, string_length, memory_capacity초기화

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

C++ 프로그래밍 실습4주차

Contents

• Exercise01~03

• Practice04

• Submit

Exercise01

Exercise02

Exercise03_1

Exercise03_2

Practice04

Make Your String Class.

다음 페이지 Header File를 참고하여 조건에 맞는 MyString.cpp를 작성하고

Practice04.cpp(main)가 실행되도록 하시오.

• 홈페이지 실습자료 압축파일 MyString.h, Practice04.cpp 존재

• MyString.h, MyString.cpp, Practice04.cpp 분리 필수

• 제출 시 Excersice01~04, MyString.cpp만 압축하여 제출

Practice04

• Constructor를 통해 string_content, string_length, memory_capacity 초기화

• String _length에 따른 string_content 동적 할당(new)

• ~ MyString() destructor를 통해 string_content 동적할당 해제

• set, get methods 작성

• memory_capacity는 string_length와 동일. But, reserve()를 통한 추가적 메모리 크기 할당 가능(reserve하려는 size가 현재 capacity보다 작다면아무것도 하지 않음)

• Assign() : string_length > memory_capacity 시, 다시할당

• find() : find_from 위치에서부터 str 찾는 함수

• C++ reference String class 참고

MyString.h

Practice04

<실행 화면>

Practice04.cpp(main)

<실행 화면>

• 공통사항ß

- 과제 제출 주소 : http://sclab.konkuk.ac.kr/lecture/homework/3

- 과제 제출 방법

• 홈페이지에 로그인(가입) 후 Lecture à C++ 프로그래밍à 과제제출 페이지에서

과제 압축 후 업로드하여 제출

(반드시 압축하여 제출 해야하며, 제출 기한 엄수)

• 압축 파일명 다음과 같이 지킬 것, 미 준수 시 미 채점

학번_이름.zip

• 과제

- 실습 시간에 작성한 cpp파일들을 압축하여 보내기

- 제출기한 : 2019.10.10(목) 자정까지

Submit

압축 예시

1) 제출하기 클릭

2) 제출 파일 업로드

Submit

4) 제출 한 과제 확인 및 필요시 수정

Submit

• Teaching assistant 박호림

• Office : 신공학관 1216호(SCLab)

• Email : [email protected]

• 수업 관련 질문이 있을 시 위의 메일로 연락 부탁드립니다.

Q&A