Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Created December 18, 2023 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjunichi/d193dbea6fa86e1bb4c59b6bec47fec3 to your computer and use it in GitHub Desktop.
Save kjunichi/d193dbea6fa86e1bb4c59b6bec47fec3 to your computer and use it in GitHub Desktop.
配列の初期化状況とインデックスとインクリメントの関係の確認
// This file is a "Hello, world!" in C language by gcc for wandbox.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int array[5];
int arrayB[5];
int i=0;
array[i++]=123;
arrayB[i] = -1;
for(int j = 0; j <5; j++ ) {
printf("array[%d] = %d\n", j, array[j]);
printf("arrayB[%d] = %d\n", j, arrayB[j]);
}
return EXIT_SUCCESS;
}
// GCC reference:
// https://gcc.gnu.org/
// C language references:
// https://msdn.microsoft.com/library/fw5abdx6.aspx
// https://www.gnu.org/software/gnu-c-manual/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment