Hello to all according to the theory this snippet of code :
procudes Undefined Behaviour or not? I think yes... but I am not sure.Code:
#include<stdio.h>
void f( int * restrict p , int *q);
int main( void )
{
int x=3;
f(&x , &x);
printf("%d" , x);
return 0;
}
void f ( int * restrict p , int *q )
{
(*q) += 1; // x = 4
*q = *p + 2; // x = 6
return;
}
Thank you in advance for your time.