#include <windows.h>
// + compiler option -lurlmon
int main() {
/*
HRESULT URLDownloadToFile(
LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
_Reserved_ DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
*/
if (URLDownloadToFileA(NULL, (LPCSTR) "http://your/file/path.ending", (LPSTR) "filename.ending", 0,
NULL) == S_OK) {
// download success
return 0;
}
return -1;
}