목록Summary (18)
UOMOP
#include #include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { int arr[] = { 0, 1, 2, 3}; printf("arr의 값 : %d\n\n", arr); for (int i = 0; i < 4; i++) { printf("&arr[%d] = %d\n", i, &arr[i]); printf("arr + %d = %d\n\n", i, arr + i); } }
#include #include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { int a = 10; int* ptr_a = &a; int** ptr_ptr_a = &ptr_a; printf("a : %d\n", a); printf("&a : %d\n\n", &a); printf("ptr_a : %d\n", ptr_a); printf("ptr_a + 1 : %d\n", ptr_a+1); printf("&ptr_a : %d\n", &ptr_a); printf("*ptr_a : %d\n\n", *ptr_a); printf("ptr_ptr_a = %d\n", ptr_ptr_a); printf("*ptr_ptr_a = %d\n..
#include #include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { char str1[] = "hello"; char str2[100]; strcpy(str2, str1); printf("%s\n\n", str2); //////////////////////////////// char str3[20] = "hello "; strcat(str3, "world!"); printf("%s\n\n", str3); ///////////////////////////////// char str4[] = "sample"; char str5[] = "simple"; int cmp = strcmp(str4, str5); int..
#include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; for (int i = 0; i < sizeof(arr) / sizeof(int); i++) printf("%d ", arr[i]); } #include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { int arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; printf("arr의 크기 : %d\n", sizeof(arr)); printf("int형의 크기 : %d\n", si..
#include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { int n; do { printf("제발 0을 눌러주세요!! : "); scanf("%d", &n); } while (n != 0); }
#include #define _CRT_SECURE_NO_WARNINGS #pragma warning(disable:4996) int main() { int choice; makechoice: printf("1 : new game\n"); printf("2 : load game\n"); printf("3 : setting\n"); printf("4 : credit\n\n"); printf("what? : "); scanf("%d", &choice); switch (choice) { case 1: printf("new game!\n"); break; case 2: printf("load game!\n"); break; case 3: printf("setting!\n"); break; case 4: prin..