Why the usage of pointers in C++ is not recommended ?



Why the usage of pointers in C++ is not recommended ?..

Answer / Shah Alam

The misuse of pointers can lead to undefined behavior, memory leaks, and security vulnerabilities. Improper handling of pointers can result in dangling pointers, segmentation faults, or buffer overflows. However, with proper understanding and careful programming practices, pointers remain a powerful tool for managing dynamic memory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Differentiate between a deep copy and a shallow copy?

1 Answers  


What is the difference between a constructor and a destructor in C++?

1 Answers  


What are the advantages of inheritance in c++?

1 Answers  


Why is c++ is better than c?

1 Answers  


What is stream and its types in c++?

1 Answers  


What is the difference between method and message?

5 Answers   HP,


What you know about structures in C++?

1 Answers   Agilent, ZS Associates,


What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?

3 Answers  


Enter n no. of element and delete value from desire position

1 Answers  


What is searching? Explain linear and binary search.

1 Answers  


In which memory a class gets stored(in heap /in stack)? And why??

2 Answers  


Are c and c++ similar?

1 Answers  


Categories