What's the difference between passing a struct pointer and declaring it inside the function itself? | Sololearn: Learn to code for FREE!

0

What's the difference between passing a struct pointer and declaring it inside the function itself?

I am making a queue using linked list without using global variables.

10/10/2020 5:39:21 PM

Raj Priyadarshi

1 Answer

New Answer

+1

If you declare it inside the function then you can not use it outside that function or inside another function. Passing struct pointer means you are passing that struct into the function from.outside the function than you can perform any operation on it that will also affect the original stuct object outside the function