공부하시는대에 도움이 됐으면 좋겠습니다.
답안코드 확인해주세요!
더보기
#include <stdio.h>
void set_proverb(char **q, int n);
int main(void) {
char *s = NULL;
int n;
printf("몇번째 속담을 선택하시겠습니까?");
scanf("%d", &n);
set_proverb(&s, n);
printf("selected proverb = %s\n",s);
return 0;
}
void set_proverb(char **q, int n) {
static char *array[10]= {
"A bad shearer never had a good sickle.",
"A bad workman (always) blames his tools. ",
"A bad workman quarrels with his tools.",
"A bad thing never dies.",
"A bad workman finds fault with his tools.",
"A bad workman always blames his tools.",
"A bargain is a bargain.",
"A barking dog never bites.",
"A barking dog was never a good hunter."
}
;
*q = array[n];
}
더 많은 C코드가 보고 싶다면?
댓글