squarebiz2

squarebiz2 - //get a width from a file...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//The fstream library is used to read from a file . #include <fstream> using namespace std; int main() { //variable declerations int row, col, width; int i; ofstream outfile; ifstream infile; infile.open("squarebiz2.in"); outfile.open("squarebiz2.out"); for(i=0; i<3; i++) {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //get a width from a file infile&gt;&gt;width; for(row=0; row&lt;width; row++) for(col=0; col&lt;width; col++) if((row==0)||(row==width-1)||(col==0)||(col==width-1)) outfile&lt;&lt; &quot;*&quot;; else outfile&lt;&lt;&quot; &quot;&lt;&lt;endl; } infile.close(); outfile.close(); return 0; }...
View Full Document

Ask a homework question - tutors are online