I read pointer as ornament of C that makes C a special language. However, i also used pointers in C++. I guess there are some limitations while using pointer in C++ than in C. As pointers are data types of C. If i am asked to write a program in pure C++, can i use pointers ?
I read pointer as ornament of C that makes C a special language. However,
Share
Ofcourse you can use pointers in C++. There are some instances where pointers are the only way out. For eg: to use dynamic memory allocations.
One special thing about pointers in C++ is C++ provides Smart pointers which can make your life easier. Prefer them over raw c like pointers.
Bottomline is:
Use what suits your implementation needs. Don’t adhere to fixed rules there are none really.