본문 바로가기

분류 전체보기680

[쉽게 풀어 쓴 C언어 Express] 12장 Exercise 해답 솔루션 답지 1. (a) strcat() (b) strcpy() (c) strtok() (d) gets() (e) strlen() 2. (a) '?'을 “?”로 변경 (b) if( strcmp(s, "value")==0 ) (c) strcpy(a, "Hello World!"); 3. s1이 가리키는 것은 문자열 상수로서 더 이상의 추가 공간을 가지고 있지 않기 때문에 s2가 가리키는 문자열을 저장할 수 없다. 수정한 결과는 다음과 같다. char s1[20] = "Hi! "; char *s2 = "Programmers"; strcat(s1, s2); 4. 첫번째 문장에서는 문자 배열이 선언되고 문자 배열의 초기값이 "Hello World!"가 된다. 두 번째 문장에서는 읽기 전용 메모리에 문자열 상수가 저장되고 이 .. 2020. 4. 17.
[쉽게 풀어 쓴 C언어 Express] 11장 Exercise 해답 솔루션 답지 1. (a) *(list+6) (b) *(name+3) (c) cost[8] (d) *(message+0) 2. char *p; p = &code; *p = ‘a’; 3. (3) 4. (3) 5. 5 5 계속하려면 아무 키나 누르십시오 . . . 6. 1008 2008 계속하려면 아무 키나 누르십시오 . . 7. 0 1 1 계속하려면 아무 키나 누르십시오 . . . 8. (a) void print_array(double a[]) (b) void print_array(double *a) 9. ip의 값이 전달되었기 때문에 ip를 변경할 수 없다. ip를 변경하려면 ip의 주소를 전달하여 야 한다. 더 많은 쉽게 풀어 쓴 C언어EXPRESS 이론 솔루션 https://chuinggun.tistory.com/.. 2020. 4. 17.
[쉽게 풀어 쓴 C언어 Express] 10장 Exercise 해답 솔루션 답지 1. (2) 2. (3) 3. (3), (4) 4. (1) 5. (4) 6. #define MAX_SIZE 4 int main(void) { int a[MAX_SIZE] = { 0, 1, 2, 3 } ; int b[4]; int i; for (i=0;i 2020. 4. 17.
[쉽게 풀어 쓴 C언어 Express] 9장 Exercise 해답 솔루션 답지 1. #include void f(void); double ratio; // (b) extern int counter; // (d) int main(void) { static int setting; // (f) ... } void f(void) { int number; // (a) register int index; // (c) extern int total; // (e) ... } 2. #include int a; // 파일 전체, 정적, 연결 가능 static int b; // 파일 전체, 정적, 연결 불가능 extern int c; // 파일 전체, 정적, 외부 변수 참조 int main(void) { int d; // 블록, 자동, 연결 불가능 register int e; // 블록, 자동, 연결.. 2020. 4. 17.