목록분류 전체보기 (313)
printf("ho_tari\n");
#include int main(void) { int nums[] = {1, 2, 3, 4, 5}; int *p; p = nums; // p = &nums[0]; printf("*p = %d\n", *p); ++p; // p = p + 1; printf("*p = %d\n", *p); p = nums; printf("*(p + 2) : %d\n", *(p + 2)); return 0; }
#include int main(void) { int i = 100; double d = 3.14; void *p; p = &i; //*p = 200; *(int *)p = 200; p = &d; //*p = 3.14; *(double *)p = 2.718; printf("i: %d\td: %f\n", i, d); return 0; }
#include int add(int a, int b) { return a + b; } int substract(int a, int b) { return a - b; } int main(void) { int (*fp)(int, int); fp = &add; int re = (*fp)(4, 3); printf("re: %d\n", re); fp = &substract; re = (*fp)(4, 3); printf("re: %d\n", re); return 0; }
#include int main(void) { int a; int *pa; int **ppa; a = 100; pa = &a; ppa = &pa; **ppa = 200; printf("a: %d\n", a); return 0; }
#include int main(void) { int a = 0x12345678; //int *p; char *p; p = (char*)&a; printf("*p : 0x%x\n", *p); return 0; }
#include int main(void) { int i; int nums[5]; int *p; //p = &i; p = &nums[1]; *p = 100; printf("*p : %d\n", *p); return 0; }
#include int main(void) { int a; int *p; a = 100; p = &a; *p = 200; printf("a: %d\n", a); return 0; }
#include int main(void) { int score; printf("input score : "); scanf("%d", &score); int isPass = (score >= 60); printf("score : %d - pass : %d\n", score, isPass); return 0; } #include int main(void) { int score; printf("input score : "); scanf("%d", &score); //int isPass = (score >= 60); //printf("score : %d - pass : %d\n", score, isPass); if (score >= 60) { printf("score : %d --- pass\n", score..