top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between Pointer static and static pointer?

+4 votes
590 views
What is the difference between Pointer static and static pointer?
posted Nov 18, 2013 by Giri Prasad

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

1 Answer

+2 votes

If I understood your question correctly, you want to ask what is the difference between a pointer pointing to a static variable and a static pointer.

See the following two declaration

static int * p;
and
static int abc
int  * p=abc;

First one is the static pointer which has the file/function scope. Where as second case is a pointer which is pointing to the static variable abc (again abc has a file/function scope). Pointer significance is only with the scope of abc however same pointer can be used to point to some other variable.

answer Nov 18, 2013 by Salil Agrawal
...