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0x94, 0xb8, 0x69, 0xda, 0x33, 0xe6, 0x35, 0xf9, 0xfb, 0x9f, 0x47, 0x7a, 0xbf, 0xd4, 0x2d, 0x05, 0xc3, 0x18, 0x7c, 0x7e, 0x0b, 0x63, 0x0c, 0x79, 0xc7, 0x43, 0x60, 0x0c, 0xa1, 0x6e, 0xe6, 0x76, 0xf3, 0x86, 0xe0, 0x39, 0xce, 0x13, 0xe3, 0x32, 0x43, 0x61, 0x07, 0x10, 0xbe, 0x7e, 0x7e, 0xfe, 0x39, 0x97, 0xf5, 0xad, 0xc7, 0x14, 0x3b, 0xa5, 0x33, 0x80, 0x7f, 0xf7, 0xfa, 0x32, 0x22, 0x9c, 0x84, 0x99, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82}, 1, 451, DiamondBlockTextureFile);
This code is what I tried and the too few arguments and expression expected before the opening curly bracket of the array literal are the errors I get
Proceeding is what I want to know how to do
Merely listing values inside braces does not create an array.
When defining an array, you can list initial values inside braces. In this syntax, the list of initial values is merely a list of initial values—it is not an array; it is just the syntax for listing the values to initialize the array with.
You can create an “on the fly” with a compound literal, which is a type name inside parentheses followed by a brace-enclosed list of initializers:
fwrite((const unsigned char []) { 0x89, 0x50, 0x4e, 0x47, 0x0d, … }, 1, 451, DiamondBlockTextureFile);
This is generally not good practice, particularly since the size the array, 451, can be easily miscalculated, or it might not be updated when somebody updates the elements in the array, and so on.
Better practice would be to create a named array to hold the data, if it is used only briefly:
static const unsigned char Temporary[] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, … };
fwrite(Temporary, 1, sizeof Temporary, DiamondBlockTextureFile);