Q:

What are the uses of get() member from the shared_ptr class?

My question is that what are the various ways in which get() member from the shared_ptr class can be used? And why can't we use delete to delete it?

A:

If you had a function taking a raw pointer
void f(T *t); // non-owning pointer

And you had a smart pointer to a T object, you could pass it to that function by using get()
std::shared_ptr<T> sp{new T};  // or unique_ptr
//f(sp); // no good, type mismatch
f(sp.get()); // passes the raw pointer instead

APIs taking raw pointers are common, and still useful.  I'd suggest you watch this part of Herb Sutter's talk from CppCon 2014, and probably the parts around it.
You should not attempt to delete this pointer, the smart pointer classes assume you will not do anything like that, and will still free the managed object in their own destructors when the time comes (after all, how would it know you deleted it?).
The smart pointer's job is to manage the object and delete it at the right time, if you want to manually manage the lifetime of the object (not usually recommended) then use a raw pointer.
If you do want to assume ownership of a unique_ptr you can do so by calling release().

A:

Usually you would use get() when you need to pass a raw pointer to an API that accepts such a pointer.
The shared_ptr class manages the ownership of the pointer, so it will automatically delete the owned memory when the lifetime of the smart pointer ends. If you try to delete the memory yourself then when the shared_ptr tries to deallocate you will wind up with undefined behavior.

