Thanks for Your help. The code in such form is fully correct:
Code:
#include <stdio.h>
#include <stdlib.h>
int przesun(int t[], int p);
main()
{
int k;
int w[10];
printf ("Define, how many places you want to move values: ");
scanf ("%d",&k);
printf("\n");
przesun (w,k);
}
int przesun (int t[], int p)
{
int i;
for (i=0 ; i<10 ; i++)
{
t[i]=rand();
printf("%d-th element of array is equal %d\n",i,t[i]);
}
for (i=9 ; i>=0 ; i--)
{
if((i-p)<=0)
{
t[i]=0;
printf("%d-th after moving for %d places is equal %d\n",i,p,t[i]);
}
else
{
t[i]=t[i-p];
printf("%d-th after moving for %d places is equal %d\n",i,p,t[i]);
}
}
return 0;
}
BUT I have one more question... how to define lenght of an array by giving a value? I mean I define an integer, write its value, and this integer is a length of an array.