C++ Codes
Algorithms
Algorithm Analysis in C++
Beginners
Code Snippets
Graphics
Data Structures
File Manipulation
Games
Mathematics
Miscellaneous
Visual C++ Library
C++ > Beginners Lab Assignments sample source codes
Program to find no. of Bytes in a text file
Program to find no. of Bytes in a text file #include
#include
#include
#include
#include
#include
main() { clrscr(); int c=0; char ch,file[30]; cout<<"Enter the name of the file:"; gets(file); fstream f1; f1.open(file,ios::in); if(f1.bad()) { cout<<"File can not be opened."; exit(0); } if(f1.good()) { cout<<"The current contents of the file are: "; while(f1) { f1.get(ch); c++; cout<
Privacy Policy
|
Link to Us
|
Links