I am looking to make an array that contains 256 elements each element should be incremented hence. array[0] should be 00000000000000000000000000000000 and array[1] should be 00000000000000000000000000000001 all the way up to array[255] should be 000000000000000000000000000000FF
Currently all I have is
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
unsigned char arr[16] = {[0 ... 15] = 0x00};
memset(arr, 0x00, sizeof(arr));
printf("%s\n",arr);
}
Which currently just prints a new line and that's all. My goal is to have something similar to:
...
int main()
{
unsigned char arr[256][16];
for(int i=0;i<256;i++)
{
memset(arr[i],0x00,sizeof(arr[i]));
//Add code to create each 16 byte hex string
printf("%s\n",arr[i]); //Print each 16 byte string to make sure they're correct
}
}