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 | 31 |
Tags
- django
- hadoop
- web
- agile
- program
- Book
- Java
- France
- Kuala Lumpur
- RFID
- hbase
- programming_book
- Malaysia
- management
- MySQL
- Python
- leadership
- Linux
- Spain
- Programming
- psychology
- QT
- Software Engineering
- Book review
- ubuntu
- Italy
- erlang
- essay
- comic agile
- history
Archives
- Today
- Total
const int* const pointer 본문
// http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/C/Documents/Tip#s-2 #include <stdio.h> void main() { const int i = 3; //i = 4; // compile error int* p = (int*)&i; printf("%d\t%d\n", i, *p); *p = 4; printf("%d\t%d\n", i, *p); const int ci1 = 4, ci2 = 8; // canNOT change value, can change the address const int* cip = &ci1; printf("%d\t%d\t%d\n", ci1, ci2, *cip); cip = &ci2; //*cip = 0; // compile error printf("%d\t%d\t%d\n", ci1, ci2, *cip); int i1 = 4, i2 = 8; // can change value, canNOT change the address int* const ipc = &i1; printf("%d\t%d\t%d\n", i1, i2, *ipc); //ipc = &i2; // compile error *ipc = 0; printf("%d\t%d\t%d\n", i1, i2, *ipc); const int ci3 = 3, ci4 = 4; const int* const cipc = &ci1; //cipc = &ci2; //*cipc = 0; printf("%d\t%d\t%d\n", ci3, ci4, *cipc); }
Comments