본문 바로가기
C언어

[C언어] 문자열의 배열을 인수로 받아 저장된 문자열을 전부 출력하는 pr_str_array()를 작성하시오

by 이얏호이야호 2020. 5. 5.

공부하시는대에 도움이 됐으면 좋겠습니다.

답안코드 확인해주세요!

 

더보기
#include <stdio.h>

void pr_str_array(char **dp, int n) {

	int i;

	for (i=0;i<n;i++) {

		printf("%s\n", dp[i]);

	}

}

int main(void) {

	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."

	}

	;

	pr_str_array(array, 10);

	return 0;

}


더 많은 C코드가 보고 싶다면?

https://chuinggun.tistory.com/category/C%EC%96%B8%EC%96%B4

댓글