| | |
C++ help
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2006
Posts: 7
Reputation:
Solved Threads: 0
I need some help to do the following
Count all spaces written to the output file
Count all alphabetic characters in the output file
Count all spaces written to the output file
Count all alphabetic characters in the output file
C++ Syntax (Toggle Plain Text)
include "stdafx.h" #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("checkIn.dat"); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); cout << line << endl; } myfile.close(); } else cout << "Unable to open file"; return 0; }
Last edited by cscgal; May 14th, 2006 at 12:56 am.
•
•
Join Date: Feb 2006
Posts: 54
Reputation:
Solved Threads: 2
•
•
•
•
Originally Posted by robase
I need some help to do the following
Count all spaces written to the output file
Count all alphabetic characters in the output file
C++ Syntax (Toggle Plain Text)
include "stdafx.h" #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("checkIn.dat"); if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); cout << line << endl; } myfile.close(); } else cout << "Unable to open file"; return 0; }
return 0;
![]() |
Other Threads in the C++ Forum
- Previous Thread: best compiler
- Next Thread: converting std::string to const chars?
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library linker list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





