私は[0]を使う場所を増やしたいと思います。 a++
のようなものです。私が考えることができる唯一の他の解決策は、switch caseまたはif/else if文の束ですが、それは非効率的です。これは可能ですか?Cの配列を経由して
#include <stdio.h>
int
main(void)
{
const char *a[6];
a[0]="one";
a[1]="two";
a[2]="three";
a[3]="four";
a[4]="five";
a[5]="six";
for (int i = 0; i < 6; i++)
{
printf("This old man, he played %s\nHe played knick-knack on my thumb\nKnick-knack paddywhack, give your dog a bone\nThis old man came rolling home\n\n", a[0]);
}
}
printf( "...%s ..."、a [i]); – Morpfh