top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Write a c program which restricts the movement of pointer?

0 votes
384 views
Write a c program which restricts the movement of pointer?
posted Mar 16, 2016 by Mohammed Hussain

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

By declaring a pointer as constant you can restrict the movement of pointer.
For example:
int x, y;
int *const p = &x;

Now , if p++ will not work since the movement of pointer p is restricted.

answer Mar 16, 2016 by Harshita
...