I have created a C program that consists of an integer array structure states[2] . I also need a uint32_t type array called store. I just want to copy the contents of the array states[0] into store[0] and the contents of states[1] into store[1]. I used this approach for char arrays and it seemed to work. My code looks like this:
#include <stdlib.h>
#include <stdio.h>
int main()
{
uint32_t *store[2];
int i;
int *states[2];
int states[0] = {1,0,0,1};
int states[1] = {0,0,0,2};
for (i = 0; i < 3; i++)
{
store[i] = states[i];
i++;
}
}
The code however does not execute and says the arrays that I have declared are of invalid format.I am not sure if this is the right approach to do this. Could somebody please help me out with this.