| | |
code seems to stop executing
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
#include <iostream>
#include <fstream>
int main()
{
std::ifstream file("file.txt");
if ( file )
{
int c;
while ( (c = file.get()) != EOF )
{
std::cout << static_cast<char>(c);
}
}
return 0;
} "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Other Threads in the C++ Forum
- Previous Thread: Pointers
- Next Thread: New C/C++ Source Code Search Website
| Thread Tools | Search this Thread |
api array arrays based binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game generator getline givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






