Guest User

Untitled

a guest
Feb 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. /* 1. 숫자상수 */
  2. 0, 3, 123, 012, 0x2A, 12.5
  3.  
  4. /* 2. 문자상수 */
  5. 'A', ' ', '\n'
  6.  
  7. /* 3. 문자열상수 */
  8. "Hello World", "1"
  9.  
  10. /* 4. 심볼릭상수 */
  11. #define PI 3.14
  12. enum {ZERO, ONE, TWO}
  13.  
  14. /* 5. 주소상수 */
  15. char str[] = { "brenden" };
  16. printf("%s\n", str); // 결과값 : brenden
  17. printf("%s\n", str+3);// 결과값 : nden
  18. printf("%c\n", str[3]); // 결과값 : n
  19. printf("%s\n", &str[3]); // 결과값 : nden
  20. printf("%s\n", "brenden"); // 결과값 : brenden
  21. printf("%s\n", "brenden"+3); // 결과값 : nden
  22. printf("%c\n", "brenden"[3]); // 결과값 : n
  23. printf("%s\n", &"brenden"[3]); // 결과값 : nden
Add Comment
Please, Sign In to add comment