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 (356)
      • Experiences (43)
      • Programming (79)
      • Beauties (84)
      • Me (150)

    Tag

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

    Copyright © Kakao Corp. All rights reserved.

    티스토리툴바