Thursday 25 April 2019

Why we need Pointer in Programme? tccicomputercoaching.com

Any time you need to pass a data structure you need a pointer. You can pass simple data types (char, float, or int) but if you want to get a value back from a function more than just a return value, you need a pointer.



Where you wish to pass a large chunk of memory through a function argument.

1. You would like to change a variable across files and one good practice is to send that variable as a pointer and get modified in called function.

Linked lists, where the devices are getting attached and removed at run time.

There are many advantages of pointers such as-
  • They are used to save memory.
  • When two references point to the same memory location.
  • Can be used in the form of parameter passing.
To learn Various Programming Languages like C, C++, Java, Python, .Net at TCCI Coaching Institute.

Contact us @ 9825618292

Visit us @ www.tccicomputercoaching.com

No comments:

Post a Comment