in this code i have used pointer variable temp in every function and that variable is being changed in every function . i have a doubt that won’t it lead to memory leak.
Basic pointers doubt
@gulatigarvita08 no it will not. it is defined only in that function.
i hope its cleared if yes dont forget to hit like and mark resolved
1 Like
but pointer variable can be accessed in any function right?? so how its defined in that function only
no i am talking about temp var that you are defining inside right thats why . its scope is inside only
Pointers are similar to normal variables in that you don’t need to delete them. They are removed from memory at the end of a functions execution and/or the end of the program