What is a pointer?,why we can use for pointer?,how we can use a pointer? | SoloLearn: Learn to code for FREE!

0

What is a pointer?,why we can use for pointer?,how we can use a pointer?

C

c

7/4/2020 1:42:19 AM

Vpts

3 Answers

New Answer

+10

Thenmozhi S ✨A pointer is a variable that stores a memory address. ✨A Pointer in C is used to allocate memory dynamically i.e. at run time. ✨ The pointer variable might be belonging to any of the data type such as int, float, char, double, short etc.

+2

Here is a little pointer demo I wrote some time ago. It's heavily commented so should be easy to understand. https://code.sololearn.com/cy26Sdbnc86H/#c This next one is a little more advanced. It demonstrates dynamic memory allocation and passing multidimensional arrays to functions. Once again the code is heavily commented. https://code.sololearn.com/cR4p7b4S4MCl/#c