11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

316Part V: Optional FeaturesTable 24-2 (continued)Flagios::outios::truncios::noreplaceios::binaryMeaningOpen file for output (implied for ostream).Truncate file if it exists (default).If file does exist, return error.Open file in binary mode (alternative is text mode).Table 24-3 Values for prot in the ofstream ConstructorFlagMeaningfilebuf::openprotCompatibility sharing modefilebuf::sh_noneExclusive; no sharingfilebuf::sh_readRead sharing allowedfilebuf::sh_writeWrite sharing allowedFor example, the following StreamOutput program opens the file MyName.txtand then writes some important and absolutely true information to that file:// StreamOutput - simple output to a file#include using namespace std;int main(int nNumberofArgs, char* pszArgs[]){ofstream my(“MyName.txt”);my

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!