Encapsulation (getters and setters) in C++ In C++, encapsulation is a very popular feature to hide data. All data members have to be private so outside entities are not able to access the data directly. It protects the data from modifying. If change is needed, getter and setter function should be set to access the private data from outside. Example code
Reference in C++ the lvalue can only be assigned to ReferenceReference is alias which is another name of existing variablePointer has a different address but the Reference has the same address with the variable. Address of the variable does not need to be copied Example code Result
Class and Object in C++ Data and functions are created in class and an object is created through a class.How to declare an object is almost the same way which we declare normal variables.Class members are private by default.To allocate memory, a name should be given as an instance Example code
Why do we use Dynamic Allocation? In C++, the address placed in the stack memory is removed when the program ends. However, the heap memory maintains the memory until it's deallocated manually by a programmer. The stack memory can be used to store them for a small amount of memory. It causes overflow when the stack is exceeded to limit. On the other hand, the heap has no limit for the size of me..
Function Overloading Function overloading allows you to use the same function name for more than one definition in the same scope. Function overloading has rules first, it should have the same function name. second, the number of arguments or the types should be different. Example code Result When function 'func(4)' is called in main, function 'func(int a)' executed because it coincides with the..
Call by reference & Call by value with example code Call By ValueIf you change the value of the parameter. It modifies the value in the current function only. It doesn't affect the value of the variable in the caller. Call By Reference It modifies the value of inside the function as well as outside because a reference (address) is passed. Example code Output
- Total
- Today
- Yesterday
- Javascript Algorithm
- code refactoring
- hackerrank javascript solution
- hackerrank solution
- 프로그래머스 알고리즘
- compareTo()
- rest parameter
- 알고리즘
- math.abs
- hackerrank
- equals()
- easy algorithm
- C++
- Object type casting
- repeat()
- string class in java
- hackerrank javascript
- algorithm
- spring boot application
- HackerRank Algorithm
- java
- javascript
- 프로그래머스
- ... in Javascript
- substring()
- easy javascript algorithm
- Collection Framework
- HashMap
- math.max
- 프로그래머스 알고리즘문제
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |