본문 바로가기

영넌 개발로그

검색하기
영넌 개발로그
프로필사진 영넌

  • 분류 전체보기 (71)
    • 설치 (6)
    • 코딩 (60)
      • C++ (44)
      • python (1)
      • ML , Deep (13)
      • 캐글 (0)
    • 알고리즘 연습 (5)
      • 이론 (5)
      • python 프로그래머스 (0)
Guestbook
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록object reference (1)

영넌 개발로그

[C++ 기초] 객체 참조 / 객체 참조 포인터 / this 포인터 / SLL 구현

* this ? 객체를 만들었을 때 기본적으로 그 객체를 가르키는 포인터는 this 이다. 클래스 내부에서만 사용되고, 자기자신을 가르킨다. SLL 구현 - Node를 SLL에 붙이는 코드를 Node가 갖도록 한다. (자기 스스로 붙이기) 1. class를 node #include using namespace std; class Node { public: int n; Node* next; Node(int v) : n(v), next(0) { } void addToSLL(Node *& _head) { if (_head == 0) { _head = this; } else { Node* temp = _head; while (temp->next != 0) { temp = temp->next; } temp->ne..

코딩/C++ 2020. 10. 26. 06:02
Prev 1 Next

Blog is powered by kakao / Designed by Tistory

티스토리툴바