Possible Duplicate:
Inserting characters in the middle of char array
I need to insert element in between 2 elements in a static array. I have written the following code. Please let me know if we have more efficient code than this.
int main()
{
int a[4];
a[0] = 10;
a[1] = 20;
a[2] = 30;
int x = 15;
memcpy(a+2,a+1,2);
a[1] = x;
printf("%d",a[2]);
}