answersLogoWhite

0

Define Static pointer with examples

User Avatar

Anonymous

15y ago
Updated: 8/18/2019

Static pointers are those which keep pointing to the same location.Its contents can change but it can not made to point somewhere else.

void main(void)

{

int x,*p;

p=&x;

x=10;

printf("%d",*p);

x=20;

printf("%d",*p);

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Define static communication and give examples of it?

does not accurately describe communication


Why is it not advisable to use this pointer with static members?

It is not inadvisable, it is impossible. Static member methods do not have access to a this pointer since they are not associated with any instance. Static members are scoped to the class, not to an object (an instance of the class). Only instance members have access to the this pointer.


What is diffrent between object pointer and this pointer?

'this' is an object-pointer: it points to the current object (usable only in non-static methods).


Define pointer in C?

Pointer is a variable, A variable that stores the address of another variable. Size of a pointer is 2 bytes.


What is the Use of static function?

A static function is a member function that is not associated with any instance of the class; it has no this pointer.


Define pointer to pointer in c?

Double (**) is used to denote the double pointer. As we know the pointer stores the address of variable, Double pointer stores the address of any pointer variable. Declaration : int **ptr2Ptr;


Define pointer star?

Pointer Stars are stars that are used to pinpoint other areas in the sky, such as constellations.


When does this pointer get created?

When we call non static method with respect to class object then this pointer is created which keep the reference of that object.


Why you can not use this pointer in static functions?

Because this points to the current object, but static methods don't have a current object (actually this is definition of the static methods).


Why pointer is not an object?

A pointer in itself is not an object, because it is not an instance of a class. Of course you can define a class which has only one member, which is a pointer. class Pointer { public void *ptr; }; Pointer p, q, r;


What is the standard used to define one kilogramme?

to control the pointer


Can this pointer be used within the concept of the static method?

No. When a method is declared static, it is defined outside of any individual class reference.