answersLogoWhite

0

What is stray pointer?

Updated: 12/15/2022
User Avatar

Wiki User

12y ago

Best Answer

stray pointer is a that pointer which pin points nothing or anywhere but we dont know...

for example:

int *ptr;

ptr=new int[10]; //this memory is on heap.

and at the end of the programm if we dont delete this memory mean to say

if we dont deallocate this memory then this type of pointer is pointing towards nothing or anywhere because when we work on heap deletion of pointer is must if we dont delete pointers than they pin point stray or anywhere so that sort of pointer is stray pointer.

i think you understand...

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is stray pointer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is dangling pointer reference in c plus plus?

A dangling pointer (we also use the terms stray pointer and wild pointer) is created whenever we call delete on a pointer and then try to use the pointer without reassigning it.We can also create dangling pointers inadvertently by calling a rogue function that returns a pointer to an object that is local to the function we are calling. The object will fall from scope when the function returns so the pointer is left dangling.Note that there is no such thing as a dangling pointer reference. Pointers and references are not the same. A reference is merely an alias to an object -- it consumes no memory beyond the object it refers to. Whereas a pointer is a variable that may contain the address of an object, but it requires additional memory to do so (4 bytes on 32-bit architecture). Pointers may be NULL, references can never be NULL. Pointers to valid objects require indirection, references do not. References are the preferred method of accessing an object's members, not least because they are easier to work with.


What is a sentence with the word stray?

Stray dogs often bark. stray luggage can have explosives in it.


What is the Hebrew word for stray?

to stray = ta'ah (תעה) stray (adjective) = to'eh (תועה)


Difference between pointer to constant and constant pointer?

1. pointer to a constant means you can not change what the pointer points to 2. constant pointer means you can not change the pointer.


What is triple pointer?

Example: int x; -- integer int *px= &x; -- pointer to integer int **ppx= &px; -- pointer to pointer to integer int ***pppx= &ppx; -- pointer to pointer to pointer to integer


What are pointer to pointer?

A pointer only holds an address information (location) in the memory. if a pointer holds points another pointer then it is a pointer to an other pointer. Pointer holds an address in the memory so in that address there is an other location information that shows another location.


How do you use stray in a sentence?

Did you see that stray cat run across the street.You can't stray very far off the path. That stray cat has returned.


Does resistor has stray capacitance?

Yes, all electronic components have both stray capacitance and stray inductance.


How do you calculate the stray capacitance?

stray capacitance calculation


Who sang the stray cat strut?

The Stray Cats!


What is pointer of pointer?

pointer is the variable that holds the address of another variable


How do you use stray in a sentence for a third grader?

I want to adopt that stray cat. Please don't stray from the group.