passing a NULL as an argument in a function

c++

Solution

As long as `DelBook` only invokes `delete` — nothing happens, it's a no-op. (and it is possible to invoke your `DelBook` with `NULL` as a parameter value, no extra action needed).

Problem

i created a book class which i having being working on as part of my assignment but its seems have being having one problem which i am failing to understand in my code below, this is my code ``` private: Book (string N = " ", int p = 100, string A = "", string P = "", string T = "", int Y = 2000) { cout << "Book constructor start " << N << endl; Title=N; pages=p; Author=A; Publisher=P; Type=T; Yearpublished=Y; } ~Book(void) { cout << "Book destructor start " << Title << endl; system("pause"); } public: static Book * MakeBook(string N = "", int p = 100, string A = "", string P = "",string T = "",int Y = 2000) { return new Book(N,p,A,P,T,Y); } static void DelBook(Book * X) { delete X; } ``` In the above code is a constructor and destructor, my question is what happens when I pass a `NULL` as an argument in the `stactic void DelBook` function? like this below ``` static void DelBook(NULL) { delete NULL; } ``` How can I make it compile if its possible to pass a NULL value? Thanks in advance.

Original source