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 open a file whose name is passed as command line argument
Program to open a file whose name is passed as command line argument # include
# include
# include
# include
void main(int argc,char *argv[]) { if(argc < 2) { cerr<<"Illegal Usage Correct Usage: size
"; exit(1); } ifstream in(argv[1],ios::in|ios::binary); if(!in) { cerr<<"Error opening the input file"; exit(1); } long int size=0; char ch; while(!in.eof()) { in>>ch; // cout<
Privacy Policy
|
Link to Us
|
Links