티스토리 뷰
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CArray<my,my> ary; | |
CArray<my,my&> _ary; | |
my m; | |
m.str = new char[10]; | |
memset(m.str,0,10); | |
strcat(m.str,"sds"); | |
m.i = 10; | |
ary.Add(m); | |
_ary.Add(m); | |
///////// | |
class my{ | |
public: | |
char *str; | |
int i; | |
my(){}; | |
my(const my &obj){ | |
size_t len = strlen(obj.str); | |
this->str = new char[ len+1]; | |
memcpy(this->str, obj.str, sizeof(obj.str)); | |
this->i = obj.i; | |
} | |
}; |
'프로그래밍 > C C++' 카테고리의 다른 글
effective stl item2 : Beware the illusion of container-independent code (0) | 2017.11.12 |
---|---|
effective stl item1 (choose your containers with care) (0) | 2017.11.09 |
함수포인터 이용하기 (0) | 2017.03.06 |
c++11 aliases와 template 그리고 header file (0) | 2017.02.27 |
Pointer Decay in C++ (배열의 포인터로의 붕괴) (2) | 2017.01.22 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- STL
- 악보
- 이루마
- yiruma
- printf
- python
- kernerl
- 중국
- Algorithm
- cpp
- 피아노
- peram jam
- Codejam
- 중국여행
- 드럼
- 알고리즘
- compile
- 사천
- 문자열
- C++
- Spring
- C language
- 코드잼
- Pointer
- link
- regex
- 정규표현식
- 여행
- 카카오 공채
- linux
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함