Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- c++ basic practice
- diamond inheritance
- c++ multi chatting room
- virtual inheritance
- member function pointer
- delete function
- pointer to member data
- return by reference
- this call
- constructor
- increment operator
- new&delete
- dynamic_cast
- 더 지니어스 양면포커
- vector capacity
- std::vector
- suffix return type
- base from member
- virtual function
- std::cout
- C++
- virtual function table
- conversion constructor
- discord bot
- std::endl
- placement new
- operator overloading
- vector size
- virtual destructor
- std::ostream
Archives
- Today
- Total
목록static (1)
I'm FanJae.

※ 본 포스트는 코드누리 C++ Basic 강의 내용을 보고 정리한 포스트입니다. - Car 객체를 몇개나 생성하는지 알아보고 싶다고 가정해보자.- 멤버 데이터 count를 사용해서 시도했다.#include class Car{ int speed{0};public: Car() {} ~Car() {}};int main(){ Car c1; Car c2; std::cout - 멤버 데이터를 사용하면, 객체당 한 개가 생성된다.- 각 객체가 독립적인 자신의 count 멤버 변수를 사용하므로 이 방법은 실패다. - 이번엔, 전역변수 count를 사용해서 시도해보자#include int count{0};class Car{ int speed{0};public: Car(..
C++/Basic
2024. 8. 16. 23:46