2013-10-12から1日間の記事一覧
#include <stdio.h> /*--- 配列の先頭三要素に1,2,3を代入 ---*/ void set123(int *vc) { *vc = 1; // vc[0] = 1; *(vc + 1) = 2; // vc[1] = 2; vc[2] = 3; // vc[2] = 3; } int main(void) { int i; int ary[5] = { 0 }; // 全ての要素を0で初期化 set123(ary); for</stdio.h>…
#include <stdio.h> int main(void) { int vc[5]; int *ptr = vc; printf("ptr == vc : %d\n", ptr == vc); printf("ptr == &vc[0] : %d\n", ptr == &vc[0]); printf("ptr == &vc[1] : %d\n", ptr == &vc[1]); printf("&vc[1] < &vc[2] : %d\n", &vc[1] < &vc[2]); pr</stdio.h>…
実行結果