Update Main.cpp

Use of naked pointers is highly risky, C++11 provides smart pointers for automatic memory handling. Using shared pointers guarantees automatic freeing of the memory allocated, even if  exception occurs at critical stage of the program.
Merge pull request #1 from iamOgunyinka/patch-1

Used shared mem pointers.