Skip to content

Instantly share code, notes, and snippets.

View gopi487krishna's full-sized avatar
🐧

Gopi Krishna Menon gopi487krishna

🐧
View GitHub Profile
/**
This is a pretty easy task.
Define a structure ( well this is called a trait ) called is_same inside a namespace gstd that returns true if the types
passed are same and false if types are different
prerequisites
* Templates in C++
* Specialization of Templates
* Partial Specialization of Templates
@gopi487krishna
gopi487krishna / task1.cpp
Last active May 14, 2020 11:04
This program contains an error that goes undetected during runtime ( memory leak ).Your task is to find why that error occurs and write the correct version of program such that no memory leaks occur.
/*
Task1
There are three classes in this program
1. Demo : Holds a temporary string buffer inside it
2. Base : Parent class with a Demo object inside it ( Polymorphic Base of Derived )
3. Derived : Child class that derives from Base and contains a seperate object of Demo as well
This program contains an error that goes undetected during runtime ( memory leak ).Your task is to find that error and write
the correct version of program such that no memory leaks occur.