Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 03 / sizeFile.cpp
blob: 862d56591798cd47a83dae492038b6f7f7dbfc1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <iostream>
#include <fstream>

using namespace std;

size_t getFileSize(const char* fileName)
{
	ifstream f(fileName);

	if (!f.is_open())
		return 0;

	f.seekg(0, ios::end);
	size_t pos = f.tellg();
	
	f.close();

	return pos;
}
int main()
{
	

	cout << getFileSize("sizeFile.cpp") << endl;

	return 0;
}