How *restrict / *__restrict__ works in C / C++?
- by Moraru Lilian
Here is some code I wrote:
#include <iostream>
using namespace std;
int main(void) {
int i = 7;
int *__restrict__ a = &i;
*a = 5;
int *b = &i, *c = &i;
*b = 8;
*c = 9;
cout << **&a << endl; //*a
return 0;
}
From what I've read, if I do " *a = 5 ", it changes the value of the…