C++ Program to Find the Size of a Text File in Bytes






 

#include<fstream.h>

void size()
{
ifstream f1(“File.txt”,ios::in);
char ch;
int c=0;
while(f1)
{
f1.get(ch);
c++;
}
cout<<“The Total size of the file (In Bytes) is “<<c;
f1.close();
}
void main()
{
size();
}

Click here for more C++ Programs

info@C++

C++ (pronounced “cee plus plus”).C++ is a general-purpose,powerful programming language.C++ is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. C++ was Developed by Bjarne Stroustrup starting in 1979.C++ adds OOPS-object oriented features such as classes, and other enhancements to the C programming language.


C++ Program to Find the Size of a Text File in Bytes
Rate this post




Further Reading:
http://en.wikipedia.org/wiki/Program
http://en.wikipedia.org/wiki/Find
http://en.wikipedia.org/wiki/Text
http://en.wikipedia.org/wiki/File

You read About: C++ Program to Find the Size of a Text File in Bytes

Posted by: Prateek on October 6, 2011


Previous Post: « Next Post: »

© 2017 Trendfy. All rights reserved
Blog Managed by Prateek Jaiswal