The following example shows use of the restrict keyword
applied to function parameter arrays.
void copy_array(int n, int *restrict a, int *restrict b)
{
while (n-- > 0)
*a++ = *b++;
}
The following example shows use of the restrict keyword
applied to different pointers that exist in the form of local variables.
void copy_bytes(int n, int *a, int *b)
{
int *restrict x;
int *restrict y;
x = a;
y = b;
while (n-- > 0)
*q++ = *s++;
}