tags:

views:

122

answers:

2

I use the DeleteFile and CopyFile methods. Do these functions throw exceptions or just set errno and lastError? Do I need to surround this code with try and catch?

+7  A: 

If you're referring to the Win32 API functions, the answer is no. No Win32 functions throw, because it is a C API.

jeffamaphone
+2  A: 

As @jeffamaphone says, they don't throw exceptions because they are C functions.

For errors, they return 0 and set an error code that you can retrieve via GetLastError(). Neither sets errno, because they're Windows APIs.

RichieHindle
thanks! answers were helpful
sofr