If your c compiler supports compound literals, you can use memcpy
:
memcpy(a, (int[]){3, 2, 1}, sizeof a);
If you don't plan to stick any variables in there (you can; isn't C99 amazing?), (int[])
can be replaced by (const int[])
to put the literal into static memory.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…