Minhee Lee

    c++ 1

    [C++] 동일 클래스 내 다른 생성자 호출에 관하여

    class Dot { public: int x, y; Dot() {} Dot(int x_, int y_) { x = x_; y = y_; } Dot operator = (Dot t) { x = t.x; y = t.y; return { x, y }; } }; class LineSegment { public: Dot d1, d2; LineSegment(Dot dot1, Dot dot2) { d1 = dot1; d2 = dot2; } LineSegment(int x1, int y1, int x2, int y2) { LineSegment(Dot(x1, y1), Dot(x2, y2)); } }; 이렇게 작성하고 LineSegment(int x1, int y1, int x2, int y2) 생성자 호출 시 Dot ..

    Programming 2021.05.14
    Previous
    1
    Next
    더보기
    프로필사진

    • All (349)
      • Experiences (42)
      • Programming (79)
      • Beauties (82)
      • Me (146)

    Tag

    algo, MINIngful, 컴공, CS, sogang, sogangicpcteam, cf, fabulous, 미니ingful, 미니책방, boj, CodeForces, 뮤지컬, Beyoutiful, 아름다워, 식사일기, 서강, 특별한, 대회, PS,

    Copyright © Kakao Corp. All rights reserved.

    티스토리툴바