top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is restricted pointers in C?

+3 votes

I recently came to know about Restricted pointers in C. Can anyone throw some light on how and when is it used?

posted Mar 27, 2014 by Merry

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+2 votes
Best answer

restrict is a keyword that can be used in pointer declarations. The restrict keyword is a declaration of intent given by the programmer to the compiler. It says that for the lifetime of the pointer, only it or a value directly derived from it will be used to access the object to which it points.

answer Mar 28, 2014 by Harshita Dhaliwal
Please share any example to help in better understanding.
Let me describe in simple words - The restrict type qualifier is an indication to the compiler that, if the memory addressed by the restrict-qualified pointer is modified, no other pointer will access that same memory.

A nice article just check this
Similar Questions
+4 votes

Is it valid in C

P = P1 + P2 - P3 
+2 votes

I know about the forward declaration of structure but don't know when it should be used or preferrable ? I can't envision the scenario.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.