This file contains 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
#include <stdio.h> | |
void print_number(int); | |
int main() | |
{ | |
int number = 1; | |
print_nubmer(number); | |
return 0; | |
} |
This file contains 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
char str[12] = "hello world"; | |
// 틀린 코드 | |
char str2[12]; | |
str2 = "Hello World"; |
This file contains 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
/* 1. 숫자상수 */ | |
0, 3, 123, 012, 0x2A, 12.5 | |
/* 2. 문자상수 */ | |
'A', ' ', '\n' | |
/* 3. 문자열상수 */ | |
"Hello World", "1" | |
/* 4. 심볼릭상수 */ |
This file contains 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
#include <stdio.h> | |
int main() | |
{ | |
short x = 32767; | |
short y = x + 1; | |
printf("%hd\t %hd\n", x, y); | |
return 0; | |
} |
This file contains 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
#include <stdio.h> | |
int main() | |
{ | |
char i; | |
for (i = 0; i < 200; i++) { | |
printf("i = %d\n", i); | |
} | |
} |
This file contains 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
/* case 1*/ | |
int num1 = 7; | |
int *p = &num1; | |
printf("%d\n", *p); // 결과값 : 7 | |
/* case 2*/ | |
int num2 = 7; | |
int *pp; | |
*pp = num2; | |
printf("%d\n", *pp); // 결과값 : Run Time Error |
This file contains 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
#include <stdio.h> | |
int main() | |
{ | |
/* case 1 */ | |
int ary1[5] = { 0,1,2,3,4 }; | |
int ary2[] = { 0,1,2,3,4 }; | |
/* case 2 */ | |
int ary3[5] = { 0 }; |
This file contains 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
#include <stdio.h> | |
int main() | |
{ | |
int ary[5]; | |
for (int i = 0; i < 5; i++) { | |
scanf("%d", &ary[i]); | |
} | |
return 0; | |
} |
This file contains 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
#include <stdio.h> | |
int main() | |
{ | |
/* case1 */ | |
int ary1[4][3] = { {1,1,1} , {2,2,2}, {3,3,3},{4,4,4} }; | |
int ary2[4][3] = { 1,1,1,2,2,2,3,3,3,4,4,4 }; | |
/* case2 */ | |
int ary3[4][3] = { 0 }; |
This file contains 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
#include <stdio.h> | |
void array_input(int(*)[3], int, int); | |
int main() | |
{ | |
int a[4][3]; | |
int row, col; | |
row = sizeof(a) / sizeof(a[0]); // 48 / 12 = 4; |
OlderNewer