I'm trying to write the 101010 pattern to the few memory location's, Is the logic correct? : The error while compiling the code is and I notice the error while compiling "a value of type "int *" cannot be assigned to an entity of type "int". I'm concerned about the logic, someone help me? 

    #include <stdio.h>
    #include <stdlib.h>
    int main()
        {
 
              int memory =0x10101010u; 
               //  printf("the value of memory %d",memory);   
              int n = 1024; 
              int* mem_allocate;
              int loop = 0;
              int i = 0; 
              mem_allocate = (int*) malloc(n*sizeof(int));    
              for(i=0; i<10; i++) 
                  {
                       int* temp; 
                       temp = ((int*) mem_allocate + i);
                       *temp = (int*)memory; 
                       *mem_allocate = temp;   
                       if (i == 9)
                       {
                             loop = 1; 
                        }
      
                   }
                   if (loop == 1) 
                   {
                        free(mem_allocate); 
                   }
                   return 0; 
         }
