20130625【C言語】文字列を扱うポインタの配列
お題
文字列を扱うポインタの配列について調べる
ソース
#include <stdio.h>
int main(void){
char *str[3] = { "Hello", "GoodBye", "Thankyou"};
int i;
for( i = 0; i < 3; i++){
printf("%s\n",str[i]); // 配列の各要素の値が出力される
}
return ;
}
実行結果
Hello
GoodBye
Thankyou