Then do coding in java, why r u here? Its depend on your program methodology. And if someone is here than atleast he should know the basic concept of c++(memory allocation). You shouldnt have to think about what they do with this code or if he /she will understand this code or not. Okay, point out the line that is causing memory leak in my code.