How to get File Size in C++.

Hi, this code will help to get file size in C++.

int GetszFile (char *szFileName)
{
 DWORD dwSize;
 HANDLE hFile;
    hFile = CreateFile (szFileName,
                        GENERIC_READ,
                        FILE_SHARE_READ,
                        NULL,
                        OPEN_EXISTING,
                        FILE_ATTRIBUTE_READONLY,
                        NULL);
dwSize = GetFileSize (hFile,
                       NULL); 
 CloseHandle(hFile);
 return dwSize;
}

Comments

  1. As Salam O Allikum Dear Brother
    You did really great job it s not really required by the market if we can do some thing like handling system like monitoring pc ,Embedded programming or else we can go for some thing like some greta usage of web services in some laguage or else we can go Angular or Jquery that canhelp yopu also and others …………. and You can get knowledge along with earning . I also need guidnace i thought you are on wrong path so i thoguht to remibnd you nothing else

  2. Pingback: Timothy

Leave a Reply

Your email address will not be published.