I have the following method in C++:
In case the folder already exists, the correct message is displayed on the screen. However, if the folder does NOT exist, nothing is displayed on the screen, that is, the part identified by case NULL is not executed. How can I solve this problem?
In other words, how can I get the code after the case NULL to run if the folder does not exist?
The spec say that as long as CreateDirectory succeeds, the return value is nonzero.
CreateDirectory
So why don’t you use an else to the if clause to print that
At max you can use a default in your switch to print
“There was some error”.
Since the switch only executes in case of an error